[OPEN-ILS-DEV] Help with authority.merge_records

Whalen, Liam Liam.Whalen at NRCan-RNCan.gc.ca
Thu Sep 29 08:18:03 EDT 2011


> -----Original Message-----
> From: open-ils-dev-bounces at list.georgialibraries.org 
> [mailto:open-ils-dev-bounces at list.georgialibraries.org] On 
> Behalf Of Mike Rylander
> Sent: September 28, 2011 22:22
> To: Evergreen Development Discussion List
> Subject: Re: [OPEN-ILS-DEV] Help with authority.merge_records
> 
> On Wed, Sep 28, 2011 at 12:03 PM, Whalen, Liam 
> <Liam.Whalen at nrcan-rncan.gc.ca> wrote:
> > Our Authority merging process is not working properly.  Here is my
> > situation: I have two bib records linked to two separate 
> authority records.
> > Lets say Bib1 is Linked to Auth1 and Bib2 is linked to Auth2.  If I 
> > merge
> > Auth2 into Auth1, the new Auth1 record displays as having 2 records 
> > associated with it, so I assume the linking in 
> authority.bib_linking 
> > is happening correctly.  However, when I examine the MARC 
> in Bib2, the 
> > authority link is still listed as $a Auth2.  However, the 
> $0 code is 
> > correctly updated.  So if Bib1 has a 650 with $a Auth1 $0 
> > (NRCAN-RNCAN) 1, and Bib2 had a 650 with $a Auth2 $0 
> (NRCAN-RNCAN) 2, 
> > then after the update
> > Bib1 would still be the same but Bib2 would have a 650 like so: $a 
> > Auth2 $0
> > (NRCAN-RNCAN) 1 (It should be $a Auth1 $0 (NRCAN-RNCAN) 1 
> after the update).
> >
> 
> First, I'm looking at the master codebase (you didn't mention 
> which you're testing or using), so this may not apply for you.

Sorry, I'm working with Evergreen 2.0.8, PostgreSQL 9.0, Opensrf 2.0.0,
And, Ubuntu 10.04.

> 
> I'm not seeing this issue, but the most likely cause looks to 
> be a missing or disabled trigger on authority.record_entry -- 
> specifically the trigger called aaa_auth_ingest_or_delete 
> which calls authority.indexing_ingest_or_delete().  What's 
> the output of
> 
>    \d authority.record_entry
> 
> in psql?

This is the output of \d authority.record_entry in psql

                                        Table "authority.record_entry"
    Column    |           Type           |                              Modifiers
--------------+--------------------------+---------------------------------------------------------------------
 id           | bigint                   | not null default nextval('authority.record_entry_id_seq'::regclass)
 creator      | integer                  | not null default 1
 editor       | integer                  | not null default 1
 create_date  | timestamp with time zone | not null default now()
 edit_date    | timestamp with time zone | not null default now()
 active       | boolean                  | not null default true
 deleted      | boolean                  | not null default false
 source       | integer                  |
 marc         | text                     | not null
 last_xact_id | text                     | not null
 owner        | integer                  |
Indexes:
    "record_entry_pkey" PRIMARY KEY, btree (id)
    "unique_by_heading_and_thesaurus" UNIQUE, btree (authority.normalize_heading(marc)) WHERE deleted IS FALSE OR deleted = false
    "authority_record_deleted_idx" btree (deleted) WHERE deleted IS FALSE OR deleted = false
    "authority_record_entry_creator_idx" btree (creator)
    "authority_record_entry_editor_idx" btree (editor)
Referenced by:
    TABLE "vandelay.authority_match" CONSTRAINT "authority_match_eg_record_fkey" FOREIGN KEY (eg_record) REFERENCES authority.record_entry(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "authority.bib_linking" CONSTRAINT "bib_linking_authority_fkey" FOREIGN KEY (authority) REFERENCES authority.record_entry(id)
    TABLE "vandelay.queued_authority_record" CONSTRAINT "queued_authority_record_imported_as_fkey" FOREIGN KEY (imported_as) REFERENCES authority.record_entry(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "authority.record_note" CONSTRAINT "record_note_record_fkey" FOREIGN KEY (record) REFERENCES authority.record_entry(id) DEFERRABLE INITIALLY DEFERRED
Rules:
    protect_authority_rec_delete AS
    ON DELETE TO authority.record_entry DO INSTEAD  UPDATE authority.record_entry SET deleted = true
  WHERE old.id = record_entry.id
Triggers:
    a_marcxml_is_well_formed BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE biblio.check_marcxml_well_formed()
    aaa_auth_ingest_or_delete AFTER INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE authority.indexing_ingest_or_delete()
    b_maintain_901 BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE evergreen.maintain_901()
    c_maintain_control_numbers BEFORE INSERT OR UPDATE ON authority.record_entry FOR EACH ROW EXECUTE PROCEDURE maintain_control_numbers()

I'm going to try and install the postgreSQL debugging libraries today, and see if I can step through the SQL to find out what the problem is.  Any other help is much appreciated.

Liam


More information about the Open-ils-dev mailing list