[open-ils-commits] r18302 - branches/rel_1_6/Open-ILS/src/sql/Pg (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Oct 12 22:27:30 EDT 2010
Author: miker
Date: 2010-10-12 22:27:28 -0400 (Tue, 12 Oct 2010)
New Revision: 18302
Modified:
branches/rel_1_6/Open-ILS/src/sql/Pg/002.functions.config.sql
branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.1-1.6.2-upgrade-db.sql
Log:
backport oils_xpath wrappers
Modified: branches/rel_1_6/Open-ILS/src/sql/Pg/002.functions.config.sql
===================================================================
--- branches/rel_1_6/Open-ILS/src/sql/Pg/002.functions.config.sql 2010-10-13 00:30:06 UTC (rev 18301)
+++ branches/rel_1_6/Open-ILS/src/sql/Pg/002.functions.config.sql 2010-10-13 02:27:28 UTC (rev 18302)
@@ -18,6 +18,10 @@
BEGIN;
+/* this makes us require PG 8.3+ */
+CREATE OR REPLACE FUNCTION oils_xpath ( TEXT, TEXT, ANYARRAY ) RETURNS TEXT[] AS 'SELECT XPATH( $1, $2::XML, $3 )::TEXT[];' LANGUAGE SQL IMMUTABLE;
+CREATE OR REPLACE FUNCTION oils_xpath ( TEXT, TEXT ) RETURNS TEXT[] AS 'SELECT XPATH( $1, $2::XML )::TEXT[];' LANGUAGE SQL IMMUTABLE;
+
/*
CREATE OR REPLACE FUNCTION oils_xml_transform ( TEXT, TEXT ) RETURNS TEXT AS $_$
SELECT CASE WHEN (SELECT COUNT(*) FROM config.xml_transform WHERE name = $2 AND xslt = '---') > 0 THEN $1
Modified: branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.1-1.6.2-upgrade-db.sql
===================================================================
--- branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.1-1.6.2-upgrade-db.sql 2010-10-13 00:30:06 UTC (rev 18301)
+++ branches/rel_1_6/Open-ILS/src/sql/Pg/1.6.1-1.6.2-upgrade-db.sql 2010-10-13 02:27:28 UTC (rev 18302)
@@ -1,5 +1,9 @@
BEGIN;
+/* this makes us require PG 8.3+ */
+CREATE OR REPLACE FUNCTION oils_xpath ( TEXT, TEXT, ANYARRAY ) RETURNS TEXT[] AS 'SELECT XPATH( $1, $2::XML, $3 )::TEXT[];' LANGUAGE SQL IMMUTABLE;
+CREATE OR REPLACE FUNCTION oils_xpath ( TEXT, TEXT ) RETURNS TEXT[] AS 'SELECT XPATH( $1, $2::XML )::TEXT[];' LANGUAGE SQL IMMUTABLE;
+
-- Start picking up call number label prefixes and suffixes
-- from asset.copy_location
ALTER TABLE asset.copy_location ADD COLUMN label_prefix TEXT;
More information about the open-ils-commits
mailing list