Dropping the evergreen schema cascaded and wiped out some previously
defined functions, so move it ahead of the other functions. (And maybe
we can start moving those public functions into the evergreen schema?)
DROP AGGREGATE IF EXISTS exists on any version of PostgreSQL that we
care about for Evergreen 2.0, so we can use it to avoid false errors
during schema creation.
FTS config was complaining about public.english_nostop in the ALTER
statement, so remove the schema qualification. This seems to have
been there for a long time?
Use IF EXISTS when dropping the unapi schema to avoid an error.
git-svn-id: svn://svn.open-ils.org/ILS/trunk@19723
dcc99617-32d9-48b4-a31d-
7c20da2025e4
CREATE TEXT SEARCH CONFIGURATION title ( COPY = pg_catalog.english );
ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR word, hword, hword_part WITH pg_catalog.simple;
-ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH public.english_nostop;
+ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH english_nostop;
CREATE TEXT SEARCH CONFIGURATION author ( COPY = title );
CREATE TEXT SEARCH CONFIGURATION subject ( COPY = title );
CREATE TEXT SEARCH CONFIGURATION keyword ( COPY = title );
CREATE TEXT SEARCH CONFIGURATION title ( COPY = pg_catalog.english );
ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR word, hword, hword_part WITH pg_catalog.simple;
-ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH public.english_nostop;
+ALTER TEXT SEARCH CONFIGURATION title ALTER MAPPING FOR asciiword, asciihword, hword_asciipart WITH english_nostop;
CREATE TEXT SEARCH CONFIGURATION author ( COPY = title );
CREATE TEXT SEARCH CONFIGURATION subject ( COPY = title );
CREATE TEXT SEARCH CONFIGURATION keyword ( COPY = title );
*
*/
--- 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;
+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(tsvector) CASCADE;
+
CREATE AGGREGATE array_accum (
sfunc = array_append,
basetype = anyelement,
-- Rather than polluting the public schema with general Evergreen
-- functions, carve out a dedicated schema
+
+DROP SCHEMA IF EXISTS evergreen CASCADE;
+
+BEGIN;
+
CREATE SCHEMA evergreen;
CREATE OR REPLACE FUNCTION evergreen.lowercase( TEXT ) RETURNS TEXT AS $$
return lc(shift);
$$ LANGUAGE PLPERLU STRICT IMMUTABLE;
+
+COMMIT;
-DROP SCHEMA unapi CASCADE;
+DROP SCHEMA IF EXISTS unapi CASCADE;
BEGIN;
CREATE SCHEMA unapi;
001.schema.offline.sql
+ 002.functions.general.sql
002.schema.config.sql
002.functions.aggregate.sql
002.functions.config.sql
- 002.functions.general.sql
005.schema.actors.sql
006.schema.permissions.sql