[OPEN-ILS-GENERAL] Bulk deletion of authority records from Evergreen database?
Linda Jansova
skolkova at chello.cz
Sun Nov 8 10:58:47 EST 2015
Dear Yamil,
Thanks a lot for sharing the approach with setting authority records'
status to deleted! We have just used it on our test server and so far it
seems it would work for us :-)!
As we only had a handful of authority records attached to bibs, we have
used the following simple SQL statement:
UPDATE authority.record_entry SET active='F', deleted='T' WHERE id<>7347
AND id<>11 AND id<>1 AND id<>9 AND id<>10;
Thank you once again, you have saved us quite some work when we would
otherwise have to merge records!
Linda
On 29.10.2015 15:24, Yamil Suarez wrote:
> Linda,
>
> I have some experience with authorities, though I did not write any of
> the underlying code so I hope others chime in. My uneducated
> impression that I have so far is that within the database authorities
> records share a lot of the design of of bib records.
>
> For example, the main table for bib records and auths are both called
> "record_entry" though they have their own separate DB schema
> (authority.record_entry v.s. biblio.record_entry).
>
> Therefore one approach to batch delete authorities is to use SQL to
> set the authority.record_entry boolean column "deleted" to a value of
> "true." I have seen this approach taken with bibs, though of course in
> this approach "deleted = true" the bib or authority record is not
> actually destroyed but just hidden from view.
>
> I would want to hear from someone else to see if there are other
> authority tables that should be updated too for this "deleted"
> approach or perhaps this is good enough.
>
> Also, at this point I do not know how to write a SQL code that would
> only list authorities that have not been linked, so that you only
> delete the ones you want.
>
> Of course there is a way with SQL to actually erase/destroy the
> authority records, but I would first want to hear from others if there
> are additional authority related tables/rows (besides
> authority.record_entry) that should also be deleted at the same time.
> Therefore keeping your database free from unnecessary table rows. BTW,
> one reason you see a lot of EG folks use the "deleted = true" approach
> instead of completely erasing records is to guard against accidental
> deletions, because this way you can easily undo a deletion.
>
> Hope this helps, and if it does I can supply some sample SQL code to
> get you started.
>
> Good luck,
> Yamil
>
>
>
>
>
>
>
>
>
>
>
>
> On Thu, Oct 29, 2015 at 2:31 AM, Linda Jansova <skolkova at chello.cz> wrote:
>> Hi all,
>>
>> We are on 2.8.2 and just trying to delete authority records that are not
>> attached to bib records (or even remove all authority records from our
>> database as a vast majority of these records have been imported by accident
>> when one import file was confused with another).
>>
>> Any ideas how to perform this task safely?
>>
>> Thank you in advance for any clues :-)!
>>
>> Linda
>
>
More information about the Open-ils-general
mailing list