[open-ils-commits] r9980 - trunk/Open-ILS/src/sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Jul 7 09:33:08 EDT 2008
Author: dbs
Date: 2008-07-07 09:33:07 -0400 (Mon, 07 Jul 2008)
New Revision: 9980
Modified:
trunk/Open-ILS/src/sql/Pg/002.functions.aggregate.sql
Log:
Restore PostgreSQL 8.1 support in trunk schema
Modified: trunk/Open-ILS/src/sql/Pg/002.functions.aggregate.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.functions.aggregate.sql 2008-07-07 13:29:03 UTC (rev 9979)
+++ trunk/Open-ILS/src/sql/Pg/002.functions.aggregate.sql 2008-07-07 13:33:07 UTC (rev 9980)
@@ -15,10 +15,16 @@
*
*/
+-- Allow these to fail gracelessly outside the transaction
+-- because PostgreSQL 8.1 does not support IF EXISTS
+DROP AGGREGATE array_accum(anyelement) CASCADE;
+DROP AGGREGATE public.first(anyelement) CASCADE;
+DROP AGGREGATE public.last(anyelement) CASCADE;
+DROP AGGREGATE public.agg_text(text) CASCADE;
+DROP AGGREGATE public.agg_tsvector(tsvector) CASCADE;
+
BEGIN;
-DROP AGGREGATE IF EXISTS array_accum(anyelement) CASCADE;
-
CREATE AGGREGATE array_accum (
sfunc = array_append,
basetype = anyelement,
@@ -30,8 +36,6 @@
SELECT CASE WHEN $1 IS NULL THEN $2 ELSE $1 END;
$$ LANGUAGE SQL STABLE;
-DROP AGGREGATE IF EXISTS public.first(anyelement) CASCADE;
-
CREATE AGGREGATE public.first (
sfunc = public.first_agg,
basetype = anyelement,
@@ -42,8 +46,6 @@
SELECT $2;
$$ LANGUAGE SQL STABLE;
-DROP AGGREGATE IF EXISTS public.last(anyelement) CASCADE;
-
CREATE AGGREGATE public.last (
sfunc = public.last_agg,
basetype = anyelement,
@@ -60,8 +62,6 @@
END;
$$ LANGUAGE SQL STABLE;
-DROP AGGREGATE IF EXISTS public.agg_text(text) CASCADE;
-
CREATE AGGREGATE public.agg_text (
sfunc = public.text_concat,
basetype = text,
@@ -78,8 +78,6 @@
END;
$$ LANGUAGE SQL STABLE;
-DROP AGGREGATE IF EXISTS public.agg_tsvector(tsvector) CASCADE;
-
CREATE AGGREGATE public.agg_tsvector (
sfunc = public.tsvector_concat,
basetype = tsvector,
More information about the open-ils-commits
mailing list