diff options
| author | Tom Lane | 2011-02-14 02:24:14 +0000 |
|---|---|---|
| committer | Tom Lane | 2011-02-14 03:54:52 +0000 |
| commit | 029fac2264101919b65fb6319bb994f941969471 (patch) | |
| tree | edb89110508318a04730a7caa42d312e050ef7ce /contrib/tsearch2 | |
| parent | 629b3af27d5c2bc9d6e16b22b943ad651d4ecb56 (diff) | |
Avoid use of CREATE OR REPLACE FUNCTION in extension installation files.
It was never terribly consistent to use OR REPLACE (because of the lack of
comparable functionality for data types, operators, etc), and
experimentation shows that it's now positively pernicious in the extension
world. We really want a failure to occur if there are any conflicts, else
it's unclear what the extension-ownership state of the conflicted object
ought to be. Most of the time, CREATE EXTENSION will fail anyway because
of conflicts on other object types, but an extension defining only
functions can succeed, with bad results.
Diffstat (limited to 'contrib/tsearch2')
| -rw-r--r-- | contrib/tsearch2/tsearch2--1.0.sql | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/contrib/tsearch2/tsearch2--1.0.sql b/contrib/tsearch2/tsearch2--1.0.sql index 40386a4c2a..369507e8f5 100644 --- a/contrib/tsearch2/tsearch2--1.0.sql +++ b/contrib/tsearch2/tsearch2--1.0.sql @@ -435,7 +435,7 @@ create type tsdebug as ( "tsvector" tsvector ); -CREATE or replace FUNCTION _get_parser_from_curcfg() +CREATE FUNCTION _get_parser_from_curcfg() RETURNS text as $$select prsname::text from pg_catalog.pg_ts_parser p join pg_ts_config c on cfgparser = p.oid where c.oid = show_curcfg();$$ LANGUAGE SQL RETURNS NULL ON NULL INPUT IMMUTABLE; @@ -461,25 +461,25 @@ where t.tokid = p.tokid $$ LANGUAGE SQL RETURNS NULL ON NULL INPUT; -CREATE OR REPLACE FUNCTION numnode(tsquery) +CREATE FUNCTION numnode(tsquery) RETURNS int4 as 'tsquery_numnode' LANGUAGE INTERNAL RETURNS NULL ON NULL INPUT IMMUTABLE; -CREATE OR REPLACE FUNCTION tsquery_and(tsquery,tsquery) +CREATE FUNCTION tsquery_and(tsquery,tsquery) RETURNS tsquery as 'tsquery_and' LANGUAGE INTERNAL RETURNS NULL ON NULL INPUT IMMUTABLE; -CREATE OR REPLACE FUNCTION tsquery_or(tsquery,tsquery) +CREATE FUNCTION tsquery_or(tsquery,tsquery) RETURNS tsquery as 'tsquery_or' LANGUAGE INTERNAL RETURNS NULL ON NULL INPUT IMMUTABLE; -CREATE OR REPLACE FUNCTION tsquery_not(tsquery) +CREATE FUNCTION tsquery_not(tsquery) RETURNS tsquery as 'tsquery_not' LANGUAGE INTERNAL @@ -487,24 +487,24 @@ CREATE OR REPLACE FUNCTION tsquery_not(tsquery) --------------rewrite subsystem -CREATE OR REPLACE FUNCTION rewrite(tsquery, text) +CREATE FUNCTION rewrite(tsquery, text) RETURNS tsquery as 'tsquery_rewrite_query' LANGUAGE INTERNAL RETURNS NULL ON NULL INPUT IMMUTABLE; -CREATE OR REPLACE FUNCTION rewrite(tsquery, tsquery, tsquery) +CREATE FUNCTION rewrite(tsquery, tsquery, tsquery) RETURNS tsquery as 'tsquery_rewrite' LANGUAGE INTERNAL RETURNS NULL ON NULL INPUT IMMUTABLE; -CREATE OR REPLACE FUNCTION rewrite_accum(tsquery,tsquery[]) +CREATE FUNCTION rewrite_accum(tsquery,tsquery[]) RETURNS tsquery AS 'MODULE_PATHNAME', 'tsa_rewrite_accum' LANGUAGE C; -CREATE OR REPLACE FUNCTION rewrite_finish(tsquery) +CREATE FUNCTION rewrite_finish(tsquery) RETURNS tsquery as 'MODULE_PATHNAME', 'tsa_rewrite_finish' LANGUAGE C; @@ -516,13 +516,13 @@ CREATE AGGREGATE rewrite ( FINALFUNC = rewrite_finish ); -CREATE OR REPLACE FUNCTION tsq_mcontains(tsquery, tsquery) +CREATE FUNCTION tsq_mcontains(tsquery, tsquery) RETURNS bool as 'tsq_mcontains' LANGUAGE INTERNAL RETURNS NULL ON NULL INPUT IMMUTABLE; -CREATE OR REPLACE FUNCTION tsq_mcontained(tsquery, tsquery) +CREATE FUNCTION tsq_mcontained(tsquery, tsquery) RETURNS bool as 'tsq_mcontained' LANGUAGE INTERNAL |
