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/chkpass | |
| 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/chkpass')
| -rw-r--r-- | contrib/chkpass/chkpass--1.0.sql | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/chkpass/chkpass--1.0.sql b/contrib/chkpass/chkpass--1.0.sql index aad74683f71..755fee3bc3f 100644 --- a/contrib/chkpass/chkpass--1.0.sql +++ b/contrib/chkpass/chkpass--1.0.sql @@ -4,12 +4,12 @@ -- Input and output functions and the type itself: -- -CREATE OR REPLACE FUNCTION chkpass_in(cstring) +CREATE FUNCTION chkpass_in(cstring) RETURNS chkpass AS 'MODULE_PATHNAME' LANGUAGE C STRICT; -CREATE OR REPLACE FUNCTION chkpass_out(chkpass) +CREATE FUNCTION chkpass_out(chkpass) RETURNS cstring AS 'MODULE_PATHNAME' LANGUAGE C STRICT; @@ -20,7 +20,7 @@ CREATE TYPE chkpass ( output = chkpass_out ); -CREATE OR REPLACE FUNCTION raw(chkpass) +CREATE FUNCTION raw(chkpass) RETURNS text AS 'MODULE_PATHNAME', 'chkpass_rout' LANGUAGE C STRICT; @@ -29,12 +29,12 @@ CREATE OR REPLACE FUNCTION raw(chkpass) -- The various boolean tests: -- -CREATE OR REPLACE FUNCTION eq(chkpass, text) +CREATE FUNCTION eq(chkpass, text) RETURNS bool AS 'MODULE_PATHNAME', 'chkpass_eq' LANGUAGE C STRICT; -CREATE OR REPLACE FUNCTION ne(chkpass, text) +CREATE FUNCTION ne(chkpass, text) RETURNS bool AS 'MODULE_PATHNAME', 'chkpass_ne' LANGUAGE C STRICT; |
