From 029fac2264101919b65fb6319bb994f941969471 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 13 Feb 2011 21:24:14 -0500 Subject: 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. --- contrib/lo/lo--1.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/lo') diff --git a/contrib/lo/lo--1.0.sql b/contrib/lo/lo--1.0.sql index 6ecb370a22..4b9a7dee32 100644 --- a/contrib/lo/lo--1.0.sql +++ b/contrib/lo/lo--1.0.sql @@ -12,11 +12,11 @@ CREATE DOMAIN lo AS pg_catalog.oid; -- The other functions that formerly existed are not needed because -- the implicit casts between a domain and its underlying type handle them. -- -CREATE OR REPLACE FUNCTION lo_oid(lo) RETURNS pg_catalog.oid AS +CREATE FUNCTION lo_oid(lo) RETURNS pg_catalog.oid AS 'SELECT $1::pg_catalog.oid' LANGUAGE SQL STRICT IMMUTABLE; -- This is used in triggers -CREATE OR REPLACE FUNCTION lo_manage() +CREATE FUNCTION lo_manage() RETURNS pg_catalog.trigger AS 'MODULE_PATHNAME' LANGUAGE C; -- cgit v1.2.1