From 29faadcd2780f74550d6a983a81bc6bad3967bd6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 14 Nov 2009 18:24:32 +0000 Subject: Make unaccent's install/uninstall scripts look more like all the others. Set search_path explicitly, don't use IF EXISTS, etc. --- contrib/unaccent/unaccent.sql.in | 13 +++++++------ contrib/unaccent/uninstall_unaccent.sql | 16 +++++++++------- 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'contrib/unaccent') diff --git a/contrib/unaccent/unaccent.sql.in b/contrib/unaccent/unaccent.sql.in index ba981398fa..1f3c3c8a4a 100644 --- a/contrib/unaccent/unaccent.sql.in +++ b/contrib/unaccent/unaccent.sql.in @@ -1,14 +1,17 @@ -/* $PostgreSQL: pgsql/contrib/unaccent/unaccent.sql.in,v 1.1 2009/08/18 10:34:39 teodor Exp $ */ +/* $PostgreSQL: pgsql/contrib/unaccent/unaccent.sql.in,v 1.2 2009/11/14 18:24:32 tgl Exp $ */ + +-- Adjust this setting to control where the objects get created. +SET search_path = public; CREATE OR REPLACE FUNCTION unaccent(regdictionary, text) RETURNS text AS 'MODULE_PATHNAME', 'unaccent_dict' - LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE; + LANGUAGE C STRICT; CREATE OR REPLACE FUNCTION unaccent(text) RETURNS text AS 'MODULE_PATHNAME', 'unaccent_dict' - LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE; + LANGUAGE C STRICT; CREATE OR REPLACE FUNCTION unaccent_init(internal) RETURNS internal @@ -21,13 +24,11 @@ CREATE OR REPLACE FUNCTION unaccent_lexize(internal,internal,internal,internal) LANGUAGE C; CREATE TEXT SEARCH TEMPLATE unaccent ( - INIT = unaccent_init, + INIT = unaccent_init, LEXIZE = unaccent_lexize ); - CREATE TEXT SEARCH DICTIONARY unaccent ( TEMPLATE = unaccent, RULES = 'unaccent' ); - diff --git a/contrib/unaccent/uninstall_unaccent.sql b/contrib/unaccent/uninstall_unaccent.sql index 89e3627fc8..f60ab564da 100644 --- a/contrib/unaccent/uninstall_unaccent.sql +++ b/contrib/unaccent/uninstall_unaccent.sql @@ -1,9 +1,11 @@ -/* $PostgreSQL: pgsql/contrib/unaccent/uninstall_unaccent.sql,v 1.1 2009/08/18 10:34:39 teodor Exp $ */ +/* $PostgreSQL: pgsql/contrib/unaccent/uninstall_unaccent.sql,v 1.2 2009/11/14 18:24:32 tgl Exp $ */ -DROP FUNCTION IF EXISTS unaccent(regdictionary, text) CASCADE; -DROP FUNCTION IF EXISTS unaccent(text) CASCADE; -DROP TEXT SEARCH DICTIONARY IF EXISTS unaccent CASCADE; -DROP TEXT SEARCH TEMPLATE IF EXISTS unaccent CASCADE; -DROP FUNCTION IF EXISTS unaccent_init(internal) CASCADE; -DROP FUNCTION IF EXISTS unaccent_lexize(internal,internal,internal,internal) CASCADE; +-- Adjust this setting to control where the objects get dropped. +SET search_path = public; +DROP FUNCTION unaccent(regdictionary, text); +DROP FUNCTION unaccent(text); +DROP TEXT SEARCH DICTIONARY unaccent; +DROP TEXT SEARCH TEMPLATE unaccent; +DROP FUNCTION unaccent_init(internal); +DROP FUNCTION unaccent_lexize(internal,internal,internal,internal); -- cgit v1.2.1