mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
/* contrib/spi/autoinc--1.0.sql */
|
||||
|
||||
CREATE OR REPLACE FUNCTION autoinc()
|
||||
CREATE FUNCTION autoinc()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* contrib/spi/insert_username--1.0.sql */
|
||||
|
||||
CREATE OR REPLACE FUNCTION insert_username()
|
||||
CREATE FUNCTION insert_username()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* contrib/spi/moddatetime--1.0.sql */
|
||||
|
||||
CREATE OR REPLACE FUNCTION moddatetime()
|
||||
CREATE FUNCTION moddatetime()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
||||
|
@ -1,11 +1,11 @@
|
||||
/* contrib/spi/refint--1.0.sql */
|
||||
|
||||
CREATE OR REPLACE FUNCTION check_primary_key()
|
||||
CREATE FUNCTION check_primary_key()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
||||
|
||||
CREATE OR REPLACE FUNCTION check_foreign_key()
|
||||
CREATE FUNCTION check_foreign_key()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
||||
|
@ -1,16 +1,16 @@
|
||||
/* contrib/spi/timetravel--1.0.sql */
|
||||
|
||||
CREATE OR REPLACE FUNCTION timetravel()
|
||||
CREATE FUNCTION timetravel()
|
||||
RETURNS trigger
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C;
|
||||
|
||||
CREATE OR REPLACE FUNCTION set_timetravel(name, int4)
|
||||
CREATE FUNCTION set_timetravel(name, int4)
|
||||
RETURNS int4
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C RETURNS NULL ON NULL INPUT;
|
||||
|
||||
CREATE OR REPLACE FUNCTION get_timetravel(name)
|
||||
CREATE FUNCTION get_timetravel(name)
|
||||
RETURNS int4
|
||||
AS 'MODULE_PATHNAME'
|
||||
LANGUAGE C RETURNS NULL ON NULL INPUT;
|
||||
|
Reference in New Issue
Block a user