From 38b587d21f098af0eafc5beec128269db5e6806b Mon Sep 17 00:00:00 2001 From: gmc Date: Thu, 21 Oct 2010 14:45:13 +0000 Subject: [PATCH] adding database update missed in previous commit Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@18435 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql diff --git a/Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql b/Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql new file mode 100644 index 0000000000..03d3acb5d5 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0444.schema.upper-bytea.sql @@ -0,0 +1,13 @@ +BEGIN; + +INSERT INTO config.upgrade_log (version) VALUES ('0444'); -- gmc + +CREATE OR REPLACE FUNCTION oils_text_as_bytea (TEXT) RETURNS BYTEA AS $_$ + SELECT CAST(REGEXP_REPLACE(UPPER($1), $$\\$$, $$\\\\$$, 'g') AS BYTEA); +$_$ LANGUAGE SQL IMMUTABLE; + +DROP INDEX asset.asset_call_number_upper_label_id_owning_lib_idx; +CREATE INDEX asset_call_number_upper_label_id_owning_lib_idx ON asset.call_number (oils_text_as_bytea(label),id,owning_lib); + +COMMIT; + -- 2.11.0