[open-ils-commits] r14475 - trunk/Open-ILS/src/sql/Pg (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Oct 17 00:41:28 EDT 2009
Author: dbs
Date: 2009-10-17 00:41:25 -0400 (Sat, 17 Oct 2009)
New Revision: 14475
Modified:
trunk/Open-ILS/src/sql/Pg/002.functions.config.sql
trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
Log:
Ensure that we don't invoke functions that have not yet been created
Modified: trunk/Open-ILS/src/sql/Pg/002.functions.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.functions.config.sql 2009-10-17 00:28:42 UTC (rev 14474)
+++ trunk/Open-ILS/src/sql/Pg/002.functions.config.sql 2009-10-17 04:41:25 UTC (rev 14475)
@@ -116,13 +116,5 @@
SELECT $2;
$$ LANGUAGE SQL;
-CREATE OR REPLACE FUNCTION public.first_word ( TEXT ) RETURNS TEXT AS $$
- SELECT SUBSTRING( $1 FROM $_$^\S+$_$);
-$$ LANGUAGE SQL;
-
-CREATE OR REPLACE FUNCTION public.naco_normalize_keep_comma( TEXT ) RETURNS TEXT AS $func$
- SELECT public.naco_normalize($1,'a');
-$func$ LANGUAGE SQL STRICT IMMUTABLE;
-
COMMIT;
Modified: trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql 2009-10-17 00:28:42 UTC (rev 14474)
+++ trunk/Open-ILS/src/sql/Pg/020.schema.functions.sql 2009-10-17 04:41:25 UTC (rev 14475)
@@ -79,6 +79,14 @@
SELECT public.naco_normalize($1,'');
$func$ LANGUAGE 'sql' STRICT IMMUTABLE;
+CREATE OR REPLACE FUNCTION public.first_word ( TEXT ) RETURNS TEXT AS $$
+ SELECT SUBSTRING( $1 FROM $_$^\S+$_$);
+$$ LANGUAGE SQL;
+
+CREATE OR REPLACE FUNCTION public.naco_normalize_keep_comma( TEXT ) RETURNS TEXT AS $func$
+ SELECT public.naco_normalize($1,'a');
+$func$ LANGUAGE SQL STRICT IMMUTABLE;
+
CREATE OR REPLACE FUNCTION public.normalize_space( TEXT ) RETURNS TEXT AS $$
SELECT regexp_replace(regexp_replace(regexp_replace($1, E'\\n', ' ', 'g'), E'(?:^\\s+)|(\\s+$)', '', 'g'), E'\\s+', ' ', 'g');
$$ LANGUAGE SQL;
More information about the open-ils-commits
mailing list