LP#1175287: drop tsearch2 only if exists as extension user/gmcharlt/lp1175287_drop_tsearch2_only_if_exists
authorGalen Charlton <gmc@esilibrary.com>
Wed, 1 May 2013 19:29:37 +0000 (15:29 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 1 May 2013 19:29:37 +0000 (15:29 -0400)
Under certain circumstances, a sufficiently old Evergreen
database might have tsearch2 as a contrib, not an extension.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/sql/Pg/upgrade/0743.schema.remove_tsearch2.sql
Open-ILS/src/sql/Pg/version-upgrade/2.3-2.4.0RC-upgrade-db.sql

index eab7d7d..8179b28 100644 (file)
@@ -45,7 +45,7 @@ ALTER TABLE metabib.subject_field_entry ALTER COLUMN index_vector TYPE pg_catalo
 ALTER TABLE metabib.title_field_entry ALTER COLUMN index_vector TYPE pg_catalog.tsvector;
 
 -- Halfway there! Goodbye tsearch2 extension!
-DROP EXTENSION tsearch2;
+DROP EXTENSION IF EXISTS tsearch2;
 
 -- Next up, re-creating all of the stuff we just dropped.
 
index 8d957db..d1cd0b5 100644 (file)
@@ -92,7 +92,7 @@ ALTER TABLE metabib.subject_field_entry ALTER COLUMN index_vector TYPE pg_catalo
 ALTER TABLE metabib.title_field_entry ALTER COLUMN index_vector TYPE pg_catalog.tsvector;
 
 -- Halfway there! Goodbye tsearch2 extension!
-DROP EXTENSION tsearch2;
+DROP EXTENSION IF EXISTS tsearch2;
 
 -- Next up, re-creating all of the stuff we just dropped.