Lp 1922567: Limit authority.full_rec.value indexes
authorJason Stephenson <jason@sigio.com>
Tue, 6 Apr 2021 11:43:52 +0000 (07:43 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Mon, 4 Oct 2021 14:50:51 +0000 (10:50 -0400)
Limit the authority_full_rec_value_index and
authority_full_rec_value_tpo_index indexes to the first 1024
characters of a field or subfield in order to avoid database errors
when inserting or updating authorities with long fields.

Include release note and regression test.

Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Jennifer Weston <jennifer.weston@equinoxOLI.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>

Open-ILS/src/sql/Pg/011.schema.authority.sql
Open-ILS/src/sql/Pg/t/regress/lp1922567-test-asset-full-rec-indexes.pg [new file with mode: 0644]
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.authority-full-rec-value-index.sql [new file with mode: 0644]
docs/RELEASE_NOTES_NEXT/Cataloging/authority-full-rec-value-index.adoc [new file with mode: 0644]

index d6e22c5..6186b18 100644 (file)
@@ -281,9 +281,9 @@ CREATE TRIGGER authority_full_rec_fti_trigger
 
 CREATE INDEX authority_full_rec_index_vector_idx ON authority.full_rec USING GIN (index_vector);
 /* Enable LIKE to use an index for database clusters with locales other than C or POSIX */
-CREATE INDEX authority_full_rec_value_tpo_index ON authority.full_rec (value text_pattern_ops);
+CREATE INDEX authority_full_rec_value_tpo_index ON authority.full_rec (SUBSTRING(value FOR 1024) text_pattern_ops);
 /* But we still need this (boooo) for paging using >, <, etc */
-CREATE INDEX authority_full_rec_value_index ON authority.full_rec (value);
+CREATE INDEX authority_full_rec_value_index ON authority.full_rec (SUBSTRING(value FOR 1024));
 
 CREATE RULE protect_authority_rec_delete AS ON DELETE TO authority.record_entry DO INSTEAD (UPDATE authority.record_entry SET deleted = TRUE WHERE OLD.id = authority.record_entry.id; DELETE FROM authority.full_rec WHERE record = OLD.id);
 
diff --git a/Open-ILS/src/sql/Pg/t/regress/lp1922567-test-asset-full-rec-indexes.pg b/Open-ILS/src/sql/Pg/t/regress/lp1922567-test-asset-full-rec-indexes.pg
new file mode 100644 (file)
index 0000000..099b3af
--- /dev/null
@@ -0,0 +1,21 @@
+BEGIN;
+
+SELECT plan(1);
+
+-- Attempt to insert an authority record that triggers the bug:
+SELECT lives_ok(
+$$INSERT INTO authority.record_entry
+(last_xact_id, heading, simple_heading, marc)
+VALUES
+('IMPORT-1337697309.74328',
+'100_-_lcsh a arenburg ile1ii ai d 1891 1967',
+'100 a arenburg ile1ii ai d 1891 1967',
+$_$<record    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"    xmlns="http://www.loc.gov/MARC21/slim"><leader>09719cz  a2200781n  4500</leader><controlfield tag="001">n  50030508 </controlfield><controlfield tag="003">DLC</controlfield><controlfield tag="005">20210213070057.0</controlfield><controlfield tag="008">800613n| azannaabn          |b aaa      </controlfield><datafield tag="010" ind1=" " ind2=" "><subfield code="a">n  50030508 </subfield></datafield><datafield tag="024" ind1="7" ind2=" "><subfield code="a">000000010813807X</subfield><subfield code="2">isni</subfield><subfield code="1">https://isni.org/isni/000000010813807X</subfield></datafield><datafield tag="024" ind1="7" ind2=" "><subfield code="a">40169930</subfield><subfield code="2">viaf</subfield><subfield code="1">http://www.viaf.org/viaf/40169930</subfield></datafield><datafield tag="024" ind1="7" ind2=" "><subfield code="a">Q348497</subfield><subfield code="2">wikidata</subfield><subfield code="1">http://www.wikidata.org/entity/Q348497</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)oca00065876</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DLC</subfield><subfield code="b">eng</subfield><subfield code="e">rda</subfield><subfield code="c">DLC</subfield><subfield code="d">DLC</subfield><subfield code="d">NjP</subfield><subfield code="d">DLC</subfield><subfield code="d">OCoLC</subfield><subfield code="d">InU</subfield><subfield code="d">CLU</subfield><subfield code="d">WU</subfield><subfield code="d">CLU</subfield></datafield><datafield tag="046" ind1=" " ind2=" "><subfield code="f">1891-01-27</subfield><subfield code="g">1967-08-31</subfield><subfield code="2">edtf</subfield></datafield><datafield tag="053" ind1=" " ind2="0"><subfield code="a">PG3476.E5</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">&#xC4;renburg, Il&#xCA;&#xB9;i&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="370" ind1=" " ind2=" "><subfield code="c">Soviet Union</subfield><subfield code="2">naf</subfield><subfield code="0">http://id.loc.gov/authorities/names/n80126312</subfield><subfield code="1">http://id.loc.gov/rwo/agents/n80126312</subfield></datafield><datafield tag="370" ind1=" " ind2=" "><subfield code="a">Ky&#xC3;&#xAF;v (Ukraine)</subfield><subfield code="2">naf</subfield><subfield code="0">http://id.loc.gov/authorities/names/n81022031</subfield><subfield code="1">http://id.loc.gov/rwo/agents/n81022031</subfield></datafield><datafield tag="370" ind1=" " ind2=" "><subfield code="c">Ukraine</subfield><subfield code="2">naf</subfield><subfield code="0">http://id.loc.gov/authorities/names/n81017756</subfield><subfield code="1">http://id.loc.gov/rwo/agents/n81017756</subfield></datafield><datafield tag="372" ind1=" " ind2=" "><subfield code="a">Journalism--Soviet Union</subfield><subfield code="2">lcsh</subfield><subfield code="0">http://id.loc.gov/authorities/subjects/sh2008106181</subfield></datafield><datafield tag="372" ind1=" " ind2=" "><subfield code="a">Russian literature</subfield><subfield code="2">lcsh</subfield><subfield code="0">http://id.loc.gov/authorities/subjects/sh85115986</subfield></datafield><datafield tag="372" ind1=" " ind2=" "><subfield code="a">Soviet literature</subfield><subfield code="2">lcsh</subfield><subfield code="0">http://id.loc.gov/authorities/subjects/sh85125831</subfield></datafield><datafield tag="374" ind1=" " ind2=" "><subfield code="a">Authors, Russian</subfield><subfield code="2">lcsh</subfield><subfield code="0">http://id.loc.gov/authorities/subjects/sh85009984</subfield></datafield><datafield tag="374" ind1=" " ind2=" "><subfield code="a">Journalists</subfield><subfield code="2">lcsh</subfield><subfield code="0">http://id.loc.gov/authorities/subjects/sh85070788</subfield></datafield><datafield tag="375" ind1=" " ind2=" "><subfield code="a">Males</subfield><subfield code="2">lcdgt</subfield></datafield><datafield tag="377" ind1=" " ind2=" "><subfield code="a">rus</subfield><subfield code="0">https://id.loc.gov/vocabulary/languages/rus</subfield></datafield><datafield tag="400" ind1="0" ind2=" "><subfield code="a">Ai-lun-pao,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="0" ind2=" "><subfield code="a">Ailunbao,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Ehrenbourg, Ilya,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="w">nnaa</subfield><subfield code="a">Ehrenburg, Il&#xCA;&#xB9;i&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1; Grigor&#xCA;&#xB9;evich,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Ehrenburg, Ilja,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Ehrenburg, Ilya,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Ehrenburg, Ilya Grigorievich,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Ehrenburg, Ilya Grigoryevich,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xC4;renburg, I.</subfield><subfield code="q">(Il&#xCA;&#xB9;i&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1;),</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xC4;renburg, Il&#xCA;&#xB9;i&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1; Grigor&#xCA;&#xB9;evich,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Erenburg, Ilya,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Erenburg, Ilyah,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">Erenmpourgk, &#xC4;lia,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD0;&#xAD;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3;, &#xD0;.</subfield><subfield code="q">(&#xD0;&#xD0;&#xBB;&#xD1;&#xD1;),</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD0;&#xAD;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3;, &#xD0;&#xD0;&#xBB;&#xD1;&#xD1;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD0;&#xAD;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3;, &#xD0;&#xD0;&#xBB;&#xD1;&#xD1; &#xD0;&#xD1;&#xD0;&#xB8;&#xD0;&#xB3;&#xD0;&#xBE;&#xD1;&#xD1;&#xD0;&#xB5;&#xD0;&#xB2;&#xD0;&#xB8;&#xD1;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xD7;&#xA8;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;.,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xD7;&#xA8;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;&#xD7;&#xD7;&#xD7;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xD7;&#xA8;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;&#xD7;&#xD7;&#xD7;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xD7;&#xA8;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;&#xD7;&#xD7;&#xD7;,</subfield><subfield code="d">1891-1967. &#xE2;&#xAC;</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xD7;&#xA8;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;&#xD7;&#xD7;&#xD7;,</subfield><subfield code="d">1981&#xD6;&#xBE;7691</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;&#xD7;&#xD7;&#xD7;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xA2;&#xD7;&#xA8;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;&#xD7;&#xD7;&#xD7;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xA2;&#xD7;&#xA8;&#xD7;&#xA2;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="400" ind1="1" ind2=" "><subfield code="a">&#xD7;&#xA2;&#xD7;&#xA8;&#xD7;&#xA2;&#xD7;&#xA0;&#xD7;&#xD7;&#xD7;&#xA8;&#xD7;, &#xD7;&#xD7;&#xD7;&#xD7;&#xD7;,</subfield><subfield code="d">1891-1967</subfield></datafield><datafield tag="667" ind1=" " ind2=" "><subfield code="a">URIs added to 3XX and/or 5XX fields in this record for the PCC URI MARC Pilot. Please do not remove or edit these URIs</subfield></datafield><datafield tag="667" ind1=" " ind2=" "><subfield code="a">Non-Latin script references not evaluated.</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Black book, c1981:</subfield><subfield code="b">t.p. (Ilya Ehrenburg)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Encyc. Americana:</subfield><subfield code="b">(Ehrenburg, Ilya Grigorievich)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Encyc. Brit. 15th:</subfield><subfield code="b">(Ehrenburg, Ilya (Grigoryevich))</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Kan, Y.T. Ai-lun-pao, 1891-1967, 1984:</subfield><subfield code="b">t.p. (Ai-lun-pao) colophon (Ailunbao)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Chernai&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1; kniga. Yiddish. Dos sh&#xE1;&#xB9;&#xBF;artse bukh, 1984:</subfield><subfield code="b">t.p. (Ilya Erenburg) t.p. verso (Ilyah Erenburg)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">nuc90-29696: His Lik vo&#xC4;&#xAD;ny (vo frant&#xEF;&#xB8;&#xA0;s&#xEF;&#xB8;&#xA1;&#xC4;&#xAB;i) [MI] 1920</subfield><subfield code="b">(usage on CU rept.: I. &#xC4;renburg)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Ob Armenii i armi&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1;nsko&#xC4;&#xAD; kul&#xCA;&#xB9;ture, 1988:</subfield><subfield code="b">t.p. (Il&#xCA;&#xB9;i&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1; &#xC4;renburg) added t.p. (Ilya &#xC4;renburg)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Literatur nach Stalins Tod, c1995:</subfield><subfield code="b">t.p. (Ilja Ehrenburg)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Kuneva, V. Ili&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1; Erenburg i Li&#xEF;&#xB8;&#xA0;u&#xEF;&#xB8;&#xA1;dmil Stoi&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1;nov, 1991.</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">To dentro, 1971:</subfield><subfield code="b">t.p. (&#xC4;lia Erenmpourgk)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Mo&#xC4;&#xAD; Parizh, 1933:</subfield><subfield code="b">t.p. (Il&#xCA;&#xB9;i &#xC4;renburga) p. 5 (&#xD0;&#xD0;&#xBB;&#xD1;&#xD1; &#xD0;&#xAD;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3; = Il&#xCA;&#xB9;i&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1; &#xC4;renburg)</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Wikipedia, Nov. 26, 2014</subfield><subfield code="b">(Il&#xCA;&#xB9;i&#xEF;&#xB8;&#xA0;a&#xEF;&#xB8;&#xA1; &#xC4;renburg; January 27 [O.S. January 15] 1891-31 August 1967;  Soviet writer, journalist, translator, and cultural figure; among the most prolific and notable authors of the Soviet Union; he published around one hundred titles. He became known first and foremost as a novelist and a journalist--in particular, as a reporter in three wars (First World War, Spanish Civil War and the Second World War))</subfield></datafield><datafield tag="670" ind1=" " ind2=" "><subfield code="a">Wikidata, February 12, 2021</subfield><subfield code="b">(location of burial: Novodevichy Cemetery; award received: Knight of the Legion of Honour, Order of Lenin, Order of the Red Banner of Labour, Order of the Red Star, Medal \, Medal \, Medal \, Stalin Prize, International Stalin Prize for Peace, Order of Lenin, Lenin Peace Prize; Commons category: Ilya Ehrenburg; place of birth: Kyiv; place of death: Moscow; date of birth: +1891-01-14T00:00:00Z, +1891-01-26T00:00:00Z; instance of: human; date of death: +1967-08-31T00:00:00Z; member of: Jewish Anti-Fascist Committee, USSR Union of Writers, World Peace Council, Supreme Soviet of the Soviet Union; occupation: journalist, writer, poet, novelist, screenwriter, translator, politician, children&apos;s writer; country of citizenship: Russian Empire, Soviet Union; cause of death: myocardial infarction; given name: Ilya; notable work: The Extraordinary Adventures of Julio Jurenito, The Thaw, Black Book, People, Years and Life; described by source: Great Soviet Encyclopedia (1969-1978), Bio-bibliographic dictionary of Russian writers of the XX century, Obalky knih.cz; languages spoken or published: French, Russian; manner of death: natural causes; child: Irina Erenburg; spouse: Lyubov Kozintseva; position held: member of the Supreme Council of the Soviet Union; native language: Russian; archives at: Central State Archives of Bulgaria; significant event: Nazi book burnings; educated at: First Moscow gymnasium; topic&apos;s main category: Category:Ilya Ehrenburg; conflict: Eastern Front; genre: novel, short story, short novel, sketch story, essay, poetry; owner of: &#xD0;&#xB0;&#xD1;&#xD1;&#xD0;&#xB8;&#xD0;&#xB2; &#xD0;&#xBD;&#xD0;&#xB0; &#xD0;&#xD0;&#xBB;&#xD1; &#xD0;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3;; member of political party: Russian Social Democratic Labour Party; writing language: Russian; sex or gender: male; alias: Ehrenburg, Erenburg, Ilia Ehrenburg, Ilia Erenburg, Ilia Grig&#xC3;&#xB3;rievich Ehrenburg, Ilya Grigoryevich Ehrenburg, Ili&#xC3;&#xA1;a Erenburg, Ilja Ehrenburg, Il&apos;ja Erenburg, Ilja G. Ehrenburg, Ilja Grigor Ehrenburg, Il&apos;ja Grigor&apos;evi&#xC4; Erenburg, I&#xC4;&#xBE;ja Grigorievi&#xC4; Ehrenburg, I&#xC4;&#xBE;ja Grigorjevi&#xC4; Erenburg, Ilja Grigorjevitsj Ehrenburg, Ilja Grigorjewitsch Erenburg, Ilya Ehrenberg, Ilya Ehrenburg, Il&apos;ya Erenburg, Ilya Gregoryevich Ehrenburg, Ilya Grigorievich Ehrenburg, &#xC4;&#xB0;lya Grigoryevi&#xC3;&#xA7; Ehrenburg, Ilya Grigoryevich Ehrenburg, Ilya Grigoryevich Erenburg, Lya Grigoryevich Ehrenburg, &#xD0;&#xAD;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3;, &#xD0;&#xAD;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3; &#xD0;., &#xD0;&#xAD;&#xD1;&#xD0;&#xB5;&#xD0;&#xBD;&#xD0;&#xB1;&#xD1;&#xD1;&#xD0;&#xB3; &#xD0;. &#xD0;.;  abART person ID: 15652; Amazon author ID: B006VYQGIO; ArhivX LOD: 79626; Babelio author ID: 18045; BAnQ author ID: 0000048970; BAV (Vatican Library: identifier) ADV12641572; BHCL ID: 91305; BHCL UUID: 76818205-3126-47ed-a204-df5ae670f73f; BIBSYS identifier: 90064171; BNE identifier: XX950248; BnF identifier: 11901820x; Brockhaus Enzyklop&#xC3;&#xA4;die online ID: ehrenburg-ilja-grigorjewitsch; BVMC person ID: 43521; CANTIC: a10078010; CiNii author identifier: DA00837084; CONOR.BG ID: 23544677; CONOR identifier: 102645603, 15712611; CONOR.SR ID: 17956711; DBNL ID: ehre001; Deutsche Biographie ID: 118529269; Dialnet author ID: 1892237; EGAXA identifier: vtls000890085; Encyclop&#xC3;&#xA6;dia Britannica Online ID: biography/Ilya-Grigoryevich-Ehrenburg; Encyclop&#xC3;&#xA6;dia Universalis ID: ilia-grigorievitch-ehrenbourg; Encyclopedia of Modern Ukraine ID: 17978; FantLab author ID: 4598; FAST-ID: 10153; Filmportal ID: 18512cefc40d4d93aa76c6e482889369; Find a Grave ID: 21425; Freebase identifier: /m/027_qc; GND identifier: 118529269; Goodreads author ID: 155894; Gran Enciclop&#xC3;&#xA8;dia Catalana ID: 0024311; Great Russian Encyclopedia Online ID: 4937559; GTAA id: 96302; Hrvatska enciklopedija ID: 18234; IDU person ID: 24804; IMDb identifier: nm0251280; Interlingual Index ID: i95016; iTunes artist ID: 1271947273; Jewish Encyclopedia ID (Russian: ) 15105; LAC identifier: 0104H8549; LCAuth identifier: n50030508; LibraryThing author ID: ehrenburgilya; Libris-URI: xv8bb9lg4vbjrrj; Librivox author ID: 12019; LIMIS person ID: 5383497; LNB identifier: 000029527; Munzinger IBA: 00000000396; National Library of Korea ID: KAC201728656; National Portrait Gallery (London: person identifier) mp95108; NDL identifier: 00438691; NE.se ID: ilja-ehrenburg; NKC identifier: jn19990210194; NLA identifier: 36555544; NLI (Israel: identifier) 000044049; NLP identifier: A11787867; NLR (Romania: identifier) 000075913; NSK identifier: 000059527; NTA identifier (Netherlands: ) 070136238; NUKAT authorities: n94204187; Open Library identifier: OL170489A; Open Library subject ID: person:ilya_grigorevich_ehrenburg_; People Australia identifier: 1289938; Perlentaucher ID: ilja-ehrenburg; PLWABN ID: 9810646542105606; PM20 folder ID: pe/004780; PTBNP identifier: 26150; Rijksmuseum Research Library authority ID: 32301; RKDartists: 271549; Runeberg author ID: ehrenilj; SELIBR: 184634; SHARE Catalogue author ID: 158169; SNAC Ark ID: w6jd7k9n; Store norske leksikon ID: Ilja_Erenburg; SUDOC authorities: 02685211X; The Paris Review interviewee ID: 4636; Union Catalog of Armenian Libraries authority ID: 20366; Unione Romana Biblioteche Scientifiche ID: 298725; University of Barcelona authority ID: a1343179; Vatican Library VcBA ID: 495/336226; WorldCat Identities ID: lccn-n50030508)</subfield><subfield code="u">https://www.wikidata.org/wiki/Q348497</subfield></datafield></record>$_$)$$,
+'Able to insert authority record with long subfield value'
+);
+
+-- If the bug it not patched, the above will fail with an error.
+
+SELECT * FROM finish();
+
+ROLLBACK;
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.authority-full-rec-value-index.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.authority-full-rec-value-index.sql
new file mode 100644 (file)
index 0000000..5fa36f2
--- /dev/null
@@ -0,0 +1,12 @@
+BEGIN;
+
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+DROP INDEX authority.authority_full_rec_value_index;
+CREATE INDEX authority_full_rec_value_index ON authority.full_rec (SUBSTRING(value FOR 1024));
+
+DROP INDEX authority.authority_full_rec_value_tpo_index;
+CREATE INDEX authority_full_rec_value_tpo_index ON authority.full_rec (SUBSTRING(value FOR 1024) text_pattern_ops);
+
+
+COMMIT;
diff --git a/docs/RELEASE_NOTES_NEXT/Cataloging/authority-full-rec-value-index.adoc b/docs/RELEASE_NOTES_NEXT/Cataloging/authority-full-rec-value-index.adoc
new file mode 100644 (file)
index 0000000..861f8bd
--- /dev/null
@@ -0,0 +1,17 @@
+Fix for Authority Records with Long Subfields
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Importing or updating authority records with long subfields, i.e. in
+the vicinity of 5,000 characters or more in length, can cause database
+errors that will prevent the update or import from happening.  The
+error occurs because non-full text indexes in PostgreSQL have a
+limited length, and long fields sometimes lead to index entries that
+exceed this maximum value.
+
+In order to rectify this issue, two database indexes on the
+`authority.full_rec` table's `value` column have been redefined to
+match their counterparts in the `metabib.real_full_rec` table.  After
+this update, only the first 1024 characters of an authority field or
+subfield will be considered by these indexes.
+
+NOTE: These indexes are not used for authority record search, though
+they are used for sorting and paging.