From: Jason Stephenson Date: Wed, 4 Feb 2015 18:38:45 +0000 (-0500) Subject: LP#1418164: Fix 0905.schema.user_currnet_normalize_heading.sql. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3984e680926a7b6fe1dd3e1147e0bb39ba585d72;p=contrib%2FConifer.git LP#1418164: Fix 0905.schema.user_currnet_normalize_heading.sql. We can't alter a table, enabling triggers in this case, while a table has trigger events pending. We move the trigger enabling to outside the transaction to resolve this. Signed-off-by: Jason Stephenson Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/sql/Pg/upgrade/0905.schema.use_current_normalize_heading.sql b/Open-ILS/src/sql/Pg/upgrade/0905.schema.use_current_normalize_heading.sql index 8edc0f9271..f526bb787e 100644 --- a/Open-ILS/src/sql/Pg/upgrade/0905.schema.use_current_normalize_heading.sql +++ b/Open-ILS/src/sql/Pg/upgrade/0905.schema.use_current_normalize_heading.sql @@ -108,10 +108,13 @@ ALTER TABLE authority.record_entry DISABLE TRIGGER map_thesaurus_to_control_set; UPDATE authority.record_entry SET id = id WHERE heading LIKE 'NOHEADING%'; +COMMIT; + +-- These need to happen outside of the transaction to avoid this: +-- ERROR: cannot ALTER TABLE "record_entry" because it has pending trigger +-- events ALTER TABLE authority.record_entry ENABLE TRIGGER a_marcxml_is_well_formed; ALTER TABLE authority.record_entry ENABLE TRIGGER aaa_auth_ingest_or_delete; ALTER TABLE authority.record_entry ENABLE TRIGGER b_maintain_901; ALTER TABLE authority.record_entry ENABLE TRIGGER c_maintain_control_numbers; ALTER TABLE authority.record_entry ENABLE TRIGGER map_thesaurus_to_control_set; - -COMMIT;