Reorder some functions to avoid creation failure on an empty db; remove unused (and...
[evergreen-equinox.git] / Open-ILS / src / sql / Pg / 002.functions.aggregate.sql
index bf4fcfa..41f8090 100644 (file)
@@ -21,7 +21,6 @@ DROP AGGREGATE IF EXISTS array_accum(anyelement) CASCADE;
 DROP AGGREGATE IF EXISTS public.first(anyelement) CASCADE;
 DROP AGGREGATE IF EXISTS public.last(anyelement) CASCADE;
 DROP AGGREGATE IF EXISTS public.agg_text(text) CASCADE;
-DROP AGGREGATE IF EXISTS public.agg_tsvector(pg_catalog.tsvector) CASCADE;
 
 CREATE AGGREGATE array_accum (
        sfunc = array_append,
@@ -66,22 +65,6 @@ CREATE AGGREGATE public.agg_text (
        stype    = text
 );
 
-CREATE OR REPLACE FUNCTION tsvector_concat ( tsvector, tsvector ) RETURNS pg_catalog.tsvector AS $$
-SELECT
-       CASE    WHEN $1 IS NULL
-                       THEN $2
-               WHEN $2 IS NULL
-                       THEN $1
-               ELSE $1 || ' ' || $2
-       END;
-$$ LANGUAGE SQL STABLE;
-
-CREATE AGGREGATE public.agg_tsvector (
-       sfunc    = tsvector_concat,
-       basetype = pg_catalog.tsvector,
-       stype    = pg_catalog.tsvector
-);
-
 CREATE OR REPLACE FUNCTION public.explode_array(anyarray) RETURNS SETOF anyelement AS $BODY$
     SELECT ($1)[s] FROM generate_series(1, array_upper($1, 1)) AS s;
 $BODY$