From 55bd5e663a1a7d3e611d124fea3aee68f54daeba Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 12 Apr 2011 13:41:19 -0400 Subject: [PATCH] Corrected merge from trunk --- Open-ILS/src/sql/Pg/000.functions.general.sql | 2 ++ Open-ILS/src/sql/Pg/012.schema.vandelay.sql | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/sql/Pg/000.functions.general.sql b/Open-ILS/src/sql/Pg/000.functions.general.sql index 52301a457f..40ab727269 100644 --- a/Open-ILS/src/sql/Pg/000.functions.general.sql +++ b/Open-ILS/src/sql/Pg/000.functions.general.sql @@ -15,6 +15,8 @@ $$ LANGUAGE plpgsql; SELECT evergreen.change_db_setting('search_path', ARRAY['evergreen','public','pg_catalog']); +CREATE OR REPLACE FUNCTION evergreen.array_remove_item_by_value(inp ANYARRAY, el ANYELEMENT) RETURNS anyarray AS $$ SELECT ARRAY_ACCUM(x.e) FROM UNNEST( $1 ) x(e) WHERE x.e <> $2; $$ LANGUAGE SQL; + CREATE OR REPLACE FUNCTION evergreen.lowercase( TEXT ) RETURNS TEXT AS $$ return lc(shift); $$ LANGUAGE PLPERLU STRICT IMMUTABLE; diff --git a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql index a9506d15d2..7b4ba02e2e 100644 --- a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql +++ b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql @@ -2,8 +2,6 @@ DROP SCHEMA IF EXISTS vandelay CASCADE; BEGIN; -CREATE OR REPLACE FUNCTION array_remove_item_by_value(inp ANYARRAY, el ANYELEMENT) RETURNS anyarray AS $$ SELECT ARRAY_ACCUM(x.e) FROM UNNEST( $1 ) x(e) WHERE x.e <> $2; $$ LANGUAGE SQL; - CREATE SCHEMA vandelay; CREATE TABLE vandelay.match_set ( @@ -520,8 +518,8 @@ BEGIN ELSIF test.required THEN FOR tmp_rec IN SELECT * FROM UNNEST(matches) LOOP IF tmp_rec NOT IN (SELECT * FROM UNNEST(potential_matches)) THEN - matches := array_remove_item_by_value(matches, tmp_rec); - potential_matches := array_remove_item_by_value(potential_matches, tmp_rec); + matches := evergreen.array_remove_item_by_value(matches, tmp_rec); + potential_matches := evergreen.array_remove_item_by_value(potential_matches, tmp_rec); END IF; END LOOP; END IF; @@ -542,8 +540,8 @@ BEGIN ELSIF test.required THEN FOR tmp_rec IN SELECT * FROM UNNEST(matches) LOOP IF tmp_rec NOT IN (SELECT * FROM UNNEST(potential_matches)) THEN - matches := array_remove_item_by_value(matches, tmp_rec); - potential_matches := array_remove_item_by_value(potential_matches, tmp_rec); + matches := evergreen.array_remove_item_by_value(matches, tmp_rec); + potential_matches := evergreen.array_remove_item_by_value(potential_matches, tmp_rec); END IF; END LOOP; END IF; -- 2.11.0