diff --git a/contrib/adminpack/adminpack.sql.in b/contrib/adminpack/adminpack.sql.in
index fcd743595a..c2da5b11a0 100644
--- a/contrib/adminpack/adminpack.sql.in
+++ b/contrib/adminpack/adminpack.sql.in
@@ -1,41 +1,52 @@
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
+
/* ***********************************************
- * Administrative functions for PostgreSQL
+ * Administrative functions for PostgreSQL
* *********************************************** */
/* generic file access functions */
-CREATE FUNCTION pg_catalog.pg_file_write(text, text, bool) RETURNS bigint
- AS 'MODULE_PATHNAME', 'pg_file_write'
- LANGUAGE C VOLATILE STRICT;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_file_write(text, text, bool)
+RETURNS bigint
+AS 'MODULE_PATHNAME', 'pg_file_write'
+LANGUAGE C VOLATILE STRICT;
-CREATE FUNCTION pg_catalog.pg_file_rename(text, text, text) RETURNS bool
- AS 'MODULE_PATHNAME', 'pg_file_rename'
- LANGUAGE C VOLATILE;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_file_rename(text, text, text)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pg_file_rename'
+LANGUAGE C VOLATILE;
-CREATE FUNCTION pg_catalog.pg_file_rename(text, text) RETURNS bool
- AS 'SELECT pg_file_rename($1, $2, NULL); '
- LANGUAGE SQL VOLATILE STRICT;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_file_rename(text, text)
+RETURNS bool
+AS 'SELECT pg_file_rename($1, $2, NULL); '
+LANGUAGE SQL VOLATILE STRICT;
-CREATE FUNCTION pg_catalog.pg_file_unlink(text) RETURNS bool
- AS 'MODULE_PATHNAME', 'pg_file_unlink'
- LANGUAGE C VOLATILE STRICT;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_file_unlink(text)
+RETURNS bool
+AS 'MODULE_PATHNAME', 'pg_file_unlink'
+LANGUAGE C VOLATILE STRICT;
-CREATE FUNCTION pg_catalog.pg_logdir_ls() RETURNS setof record
- AS 'MODULE_PATHNAME', 'pg_logdir_ls'
- LANGUAGE C VOLATILE STRICT;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_logdir_ls()
+RETURNS setof record
+AS 'MODULE_PATHNAME', 'pg_logdir_ls'
+LANGUAGE C VOLATILE STRICT;
/* Renaming of existing backend functions for pgAdmin compatibility */
-CREATE FUNCTION pg_catalog.pg_file_read(text, bigint, bigint) RETURNS text
- AS 'pg_read_file'
- LANGUAGE INTERNAL VOLATILE STRICT;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_file_read(text, bigint, bigint)
+RETURNS text
+AS 'pg_read_file'
+LANGUAGE INTERNAL VOLATILE STRICT;
-CREATE FUNCTION pg_catalog.pg_file_length(text) RETURNS bigint
- AS 'SELECT size FROM pg_stat_file($1)'
- LANGUAGE SQL VOLATILE STRICT;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_file_length(text)
+RETURNS bigint
+AS 'SELECT size FROM pg_stat_file($1)'
+LANGUAGE SQL VOLATILE STRICT;
-CREATE FUNCTION pg_catalog.pg_logfile_rotate() RETURNS int4
- AS 'pg_rotate_logfile'
- LANGUAGE INTERNAL VOLATILE STRICT;
+CREATE OR REPLACE FUNCTION pg_catalog.pg_logfile_rotate()
+RETURNS int4
+AS 'pg_rotate_logfile'
+LANGUAGE INTERNAL VOLATILE STRICT;
diff --git a/contrib/adminpack/uninstall_adminpack.sql b/contrib/adminpack/uninstall_adminpack.sql
index b748cbbf63..03703a0ac4 100644
--- a/contrib/adminpack/uninstall_adminpack.sql
+++ b/contrib/adminpack/uninstall_adminpack.sql
@@ -1,3 +1,6 @@
+-- Adjust this setting to control where the objects get dropped.
+SET search_path = public;
+
DROP FUNCTION pg_catalog.pg_file_write(text, text, bool) ;
DROP FUNCTION pg_catalog.pg_file_rename(text, text, text) ;
DROP FUNCTION pg_catalog.pg_file_rename(text, text) ;
diff --git a/contrib/btree_gist/btree_gist.sql.in b/contrib/btree_gist/btree_gist.sql.in
index 25b79e6c6b..2a463f1058 100644
--- a/contrib/btree_gist/btree_gist.sql.in
+++ b/contrib/btree_gist/btree_gist.sql.in
@@ -1,85 +1,85 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-CREATE FUNCTION gbtreekey4_in(cstring)
+CREATE OR REPLACE FUNCTION gbtreekey4_in(cstring)
RETURNS gbtreekey4
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbtreekey4_out(gbtreekey4)
+CREATE OR REPLACE FUNCTION gbtreekey4_out(gbtreekey4)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE C IMMUTABLE STRICT;
CREATE TYPE gbtreekey4 (
-INTERNALLENGTH = 4,
-INPUT = gbtreekey4_in,
-OUTPUT = gbtreekey4_out
+ INTERNALLENGTH = 4,
+ INPUT = gbtreekey4_in,
+ OUTPUT = gbtreekey4_out
);
-CREATE FUNCTION gbtreekey8_in(cstring)
+CREATE OR REPLACE FUNCTION gbtreekey8_in(cstring)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbtreekey8_out(gbtreekey8)
+CREATE OR REPLACE FUNCTION gbtreekey8_out(gbtreekey8)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE C IMMUTABLE STRICT;
CREATE TYPE gbtreekey8 (
-INTERNALLENGTH = 8,
-INPUT = gbtreekey8_in,
-OUTPUT = gbtreekey8_out
+ INTERNALLENGTH = 8,
+ INPUT = gbtreekey8_in,
+ OUTPUT = gbtreekey8_out
);
-CREATE FUNCTION gbtreekey16_in(cstring)
+CREATE OR REPLACE FUNCTION gbtreekey16_in(cstring)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbtreekey16_out(gbtreekey16)
+CREATE OR REPLACE FUNCTION gbtreekey16_out(gbtreekey16)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE C IMMUTABLE STRICT;
CREATE TYPE gbtreekey16 (
-INTERNALLENGTH = 16,
-INPUT = gbtreekey16_in,
-OUTPUT = gbtreekey16_out
+ INTERNALLENGTH = 16,
+ INPUT = gbtreekey16_in,
+ OUTPUT = gbtreekey16_out
);
-CREATE FUNCTION gbtreekey32_in(cstring)
+CREATE OR REPLACE FUNCTION gbtreekey32_in(cstring)
RETURNS gbtreekey32
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbtreekey32_out(gbtreekey32)
+CREATE OR REPLACE FUNCTION gbtreekey32_out(gbtreekey32)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE C IMMUTABLE STRICT;
CREATE TYPE gbtreekey32 (
-INTERNALLENGTH = 32,
-INPUT = gbtreekey32_in,
-OUTPUT = gbtreekey32_out
+ INTERNALLENGTH = 32,
+ INPUT = gbtreekey32_in,
+ OUTPUT = gbtreekey32_out
);
-CREATE FUNCTION gbtreekey_var_in(cstring)
+CREATE OR REPLACE FUNCTION gbtreekey_var_in(cstring)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME', 'gbtreekey_in'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbtreekey_var_out(gbtreekey_var)
+CREATE OR REPLACE FUNCTION gbtreekey_var_out(gbtreekey_var)
RETURNS cstring
AS 'MODULE_PATHNAME', 'gbtreekey_out'
LANGUAGE C IMMUTABLE STRICT;
CREATE TYPE gbtreekey_var (
-INTERNALLENGTH = VARIABLE,
-INPUT = gbtreekey_var_in,
-OUTPUT = gbtreekey_var_out,
-STORAGE = EXTENDED
+ INTERNALLENGTH = VARIABLE,
+ INPUT = gbtreekey_var_in,
+ OUTPUT = gbtreekey_var_out,
+ STORAGE = EXTENDED
);
@@ -92,42 +92,42 @@ STORAGE = EXTENDED
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_oid_consistent(internal,oid,int2)
+CREATE OR REPLACE FUNCTION gbt_oid_consistent(internal,oid,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_oid_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_oid_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_decompress(internal)
+CREATE OR REPLACE FUNCTION gbt_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_var_decompress(internal)
+CREATE OR REPLACE FUNCTION gbt_var_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_oid_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_oid_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_oid_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_oid_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_oid_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_oid_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_oid_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_oid_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -159,32 +159,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_int2_consistent(internal,int2,int2)
+CREATE OR REPLACE FUNCTION gbt_int2_consistent(internal,int2,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int2_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_int2_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int2_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_int2_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_int2_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_int2_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int2_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_int2_union(bytea, internal)
RETURNS gbtreekey4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int2_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_int2_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -215,32 +215,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_int4_consistent(internal,int4,int2)
+CREATE OR REPLACE FUNCTION gbt_int4_consistent(internal,int4,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int4_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_int4_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int4_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_int4_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_int4_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_int4_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int4_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_int4_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int4_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_int4_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -271,32 +271,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_int8_consistent(internal,int8,int2)
+CREATE OR REPLACE FUNCTION gbt_int8_consistent(internal,int8,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int8_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_int8_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int8_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_int8_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_int8_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_int8_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int8_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_int8_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_int8_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_int8_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -328,32 +328,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_float4_consistent(internal,float4,int2)
+CREATE OR REPLACE FUNCTION gbt_float4_consistent(internal,float4,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float4_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_float4_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float4_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_float4_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_float4_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_float4_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float4_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_float4_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float4_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_float4_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -387,32 +387,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_float8_consistent(internal,float8,int2)
+CREATE OR REPLACE FUNCTION gbt_float8_consistent(internal,float8,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float8_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_float8_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float8_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_float8_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_float8_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_float8_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float8_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_float8_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_float8_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_float8_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -444,42 +444,42 @@ AS
--
--
-CREATE FUNCTION gbt_ts_consistent(internal,timestamp,int2)
+CREATE OR REPLACE FUNCTION gbt_ts_consistent(internal,timestamp,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2)
+CREATE OR REPLACE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_ts_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_ts_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_tstz_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_tstz_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_ts_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_ts_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_ts_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_ts_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_ts_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_ts_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_ts_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_ts_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -530,42 +530,42 @@ AS
--
--
-CREATE FUNCTION gbt_time_consistent(internal,time,int2)
+CREATE OR REPLACE FUNCTION gbt_time_consistent(internal,time,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_timetz_consistent(internal,timetz,int2)
+CREATE OR REPLACE FUNCTION gbt_timetz_consistent(internal,timetz,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_time_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_time_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_timetz_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_timetz_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_time_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_time_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_time_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_time_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_time_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_time_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_time_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_time_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -614,32 +614,32 @@ AS
--
--
-CREATE FUNCTION gbt_date_consistent(internal,date,int2)
+CREATE OR REPLACE FUNCTION gbt_date_consistent(internal,date,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_date_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_date_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_date_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_date_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_date_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_date_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_date_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_date_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_date_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_date_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -671,37 +671,37 @@ AS
--
--
-CREATE FUNCTION gbt_intv_consistent(internal,interval,int2)
+CREATE OR REPLACE FUNCTION gbt_intv_consistent(internal,interval,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_intv_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_intv_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_intv_decompress(internal)
+CREATE OR REPLACE FUNCTION gbt_intv_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_intv_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_intv_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_intv_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_intv_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_intv_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_intv_union(bytea, internal)
RETURNS gbtreekey32
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_intv_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_intv_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -732,32 +732,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_cash_consistent(internal,money,int2)
+CREATE OR REPLACE FUNCTION gbt_cash_consistent(internal,money,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_cash_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_cash_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_cash_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_cash_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_cash_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_cash_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_cash_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_cash_union(bytea, internal)
RETURNS gbtreekey8
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_cash_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_cash_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -788,32 +788,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_macad_consistent(internal,macaddr,int2)
+CREATE OR REPLACE FUNCTION gbt_macad_consistent(internal,macaddr,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_macad_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_macad_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_macad_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_macad_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_macad_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_macad_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_macad_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_macad_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_macad_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_macad_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -846,42 +846,42 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_text_consistent(internal,text,int2)
+CREATE OR REPLACE FUNCTION gbt_text_consistent(internal,text,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2)
+CREATE OR REPLACE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_text_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_text_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bpchar_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_bpchar_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_text_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_text_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_text_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_text_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_text_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_text_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_text_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_text_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -932,32 +932,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_bytea_consistent(internal,bytea,int2)
+CREATE OR REPLACE FUNCTION gbt_bytea_consistent(internal,bytea,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bytea_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_bytea_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bytea_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_bytea_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_bytea_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_bytea_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bytea_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_bytea_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bytea_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_bytea_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -989,32 +989,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_numeric_consistent(internal,numeric,int2)
+CREATE OR REPLACE FUNCTION gbt_numeric_consistent(internal,numeric,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_numeric_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_numeric_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_numeric_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_numeric_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_numeric_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_numeric_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_numeric_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_numeric_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_numeric_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_numeric_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -1044,32 +1044,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_bit_consistent(internal,bit,int2)
+CREATE OR REPLACE FUNCTION gbt_bit_consistent(internal,bit,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bit_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_bit_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bit_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_bit_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_bit_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_bit_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bit_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_bit_union(bytea, internal)
RETURNS gbtreekey_var
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_bit_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_bit_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -1121,32 +1121,32 @@ AS
--
--
-- define the GiST support methods
-CREATE FUNCTION gbt_inet_consistent(internal,inet,int2)
+CREATE OR REPLACE FUNCTION gbt_inet_consistent(internal,inet,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_inet_compress(internal)
+CREATE OR REPLACE FUNCTION gbt_inet_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_inet_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gbt_inet_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION gbt_inet_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gbt_inet_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_inet_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gbt_inet_union(bytea, internal)
RETURNS gbtreekey16
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gbt_inet_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION gbt_inet_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
diff --git a/contrib/btree_gist/uninstall_btree_gist.sql b/contrib/btree_gist/uninstall_btree_gist.sql
index c884c16c2f..abc811ea6f 100644
--- a/contrib/btree_gist/uninstall_btree_gist.sql
+++ b/contrib/btree_gist/uninstall_btree_gist.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP OPERATOR CLASS gist_cidr_ops USING gist;
diff --git a/contrib/chkpass/chkpass.sql.in b/contrib/chkpass/chkpass.sql.in
index 40a0d722c9..44e00fcf7f 100644
--- a/contrib/chkpass/chkpass.sql.in
+++ b/contrib/chkpass/chkpass.sql.in
@@ -1,27 +1,16 @@
---
--- PostgreSQL code for CHKPASS.
--- Written by D'Arcy J.M. Cain
--- darcy@druid.net
--- http://www.druid.net/darcy/
---
--- $PostgreSQL: pgsql/contrib/chkpass/chkpass.sql.in,v 1.7 2007/09/29 23:32:42 tgl Exp $
---
--- best viewed with tabs set to 4
---
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
--
-- Input and output functions and the type itself:
--
--- Adjust this setting to control where the objects get created.
-SET search_path = public;
-
-CREATE FUNCTION chkpass_in(cstring)
+CREATE OR REPLACE FUNCTION chkpass_in(cstring)
RETURNS chkpass
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION chkpass_out(chkpass)
+CREATE OR REPLACE FUNCTION chkpass_out(chkpass)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -33,7 +22,7 @@ CREATE TYPE chkpass (
output = chkpass_out
);
-CREATE FUNCTION raw(chkpass)
+CREATE OR REPLACE FUNCTION raw(chkpass)
RETURNS text
AS 'MODULE_PATHNAME', 'chkpass_rout'
LANGUAGE C STRICT;
@@ -42,12 +31,12 @@ CREATE FUNCTION raw(chkpass)
-- The various boolean tests:
--
-CREATE FUNCTION eq(chkpass, text)
+CREATE OR REPLACE FUNCTION eq(chkpass, text)
RETURNS bool
AS 'MODULE_PATHNAME', 'chkpass_eq'
LANGUAGE C STRICT;
-CREATE FUNCTION ne(chkpass, text)
+CREATE OR REPLACE FUNCTION ne(chkpass, text)
RETURNS bool
AS 'MODULE_PATHNAME', 'chkpass_ne'
LANGUAGE C STRICT;
diff --git a/contrib/chkpass/uninstall_chkpass.sql b/contrib/chkpass/uninstall_chkpass.sql
index 34ad3fde8f..3f8cbb0c2c 100644
--- a/contrib/chkpass/uninstall_chkpass.sql
+++ b/contrib/chkpass/uninstall_chkpass.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP OPERATOR <>(chkpass, text);
diff --git a/contrib/cube/cube.sql.in b/contrib/cube/cube.sql.in
index 36a442f3ef..2e9469d58c 100644
--- a/contrib/cube/cube.sql.in
+++ b/contrib/cube/cube.sql.in
@@ -1,9 +1,9 @@
--- Create the user-defined type for N-dimensional boxes
---
-
-- Adjust this setting to control where the objects get created.
SET search_path = public;
+-- Create the user-defined type for N-dimensional boxes
+--
+
CREATE OR REPLACE FUNCTION cube_in(cstring)
RETURNS cube
AS 'MODULE_PATHNAME'
diff --git a/contrib/cube/uninstall_cube.sql b/contrib/cube/uninstall_cube.sql
index 2c5c164565..95c9d13004 100644
--- a/contrib/cube/uninstall_cube.sql
+++ b/contrib/cube/uninstall_cube.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP OPERATOR CLASS gist_cube_ops USING gist;
diff --git a/contrib/dblink/dblink.sql.in b/contrib/dblink/dblink.sql.in
index b6e8f55ab8..c55b774927 100644
--- a/contrib/dblink/dblink.sql.in
+++ b/contrib/dblink/dblink.sql.in
@@ -1,3 +1,6 @@
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
+
-- dblink_connect now restricts non-superusers to password
-- authenticated connections
CREATE OR REPLACE FUNCTION dblink_connect (text)
diff --git a/contrib/dblink/uninstall_dblink.sql b/contrib/dblink/uninstall_dblink.sql
index af4f54269a..ede9428a62 100644
--- a/contrib/dblink/uninstall_dblink.sql
+++ b/contrib/dblink/uninstall_dblink.sql
@@ -1,3 +1,6 @@
+-- Adjust this setting to control where the objects get dropped.
+SET search_path = public;
+
DROP FUNCTION dblink_current_query ();
DROP FUNCTION dblink_build_sql_update (text, int2vector, int4, _text, _text);
diff --git a/contrib/dict_int/dict_int.sql.in b/contrib/dict_int/dict_int.sql.in
index 0bd97a83e2..6fe3d539d6 100644
--- a/contrib/dict_int/dict_int.sql.in
+++ b/contrib/dict_int/dict_int.sql.in
@@ -1,16 +1,12 @@
--- $PostgreSQL: pgsql/contrib/dict_int/dict_int.sql.in,v 1.1 2007/10/15 21:36:50 tgl Exp $
-
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-BEGIN;
-
-CREATE FUNCTION dintdict_init(internal)
+CREATE OR REPLACE FUNCTION dintdict_init(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION dintdict_lexize(internal, internal, internal, internal)
+CREATE OR REPLACE FUNCTION dintdict_lexize(internal, internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -25,5 +21,3 @@ CREATE TEXT SEARCH DICTIONARY intdict (
);
COMMENT ON TEXT SEARCH DICTIONARY intdict IS 'dictionary for integers';
-
-END;
diff --git a/contrib/dict_int/uninstall_dict_int.sql b/contrib/dict_int/uninstall_dict_int.sql
index 0323ab298e..42245e7041 100644
--- a/contrib/dict_int/uninstall_dict_int.sql
+++ b/contrib/dict_int/uninstall_dict_int.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP TEXT SEARCH DICTIONARY intdict;
diff --git a/contrib/dict_xsyn/dict_xsyn.sql.in b/contrib/dict_xsyn/dict_xsyn.sql.in
index 0e5755e5b1..bae5224a24 100644
--- a/contrib/dict_xsyn/dict_xsyn.sql.in
+++ b/contrib/dict_xsyn/dict_xsyn.sql.in
@@ -1,16 +1,12 @@
--- $PostgreSQL: pgsql/contrib/dict_xsyn/dict_xsyn.sql.in,v 1.1 2007/10/15 21:36:50 tgl Exp $
-
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-BEGIN;
-
-CREATE FUNCTION dxsyn_init(internal)
+CREATE OR REPLACE FUNCTION dxsyn_init(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION dxsyn_lexize(internal, internal, internal, internal)
+CREATE OR REPLACE FUNCTION dxsyn_lexize(internal, internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -25,5 +21,3 @@ CREATE TEXT SEARCH DICTIONARY xsyn (
);
COMMENT ON TEXT SEARCH DICTIONARY xsyn IS 'eXtended synonym dictionary';
-
-END;
diff --git a/contrib/dict_xsyn/uninstall_dict_xsyn.sql b/contrib/dict_xsyn/uninstall_dict_xsyn.sql
index 7b7acea0d1..45c28e820a 100644
--- a/contrib/dict_xsyn/uninstall_dict_xsyn.sql
+++ b/contrib/dict_xsyn/uninstall_dict_xsyn.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP TEXT SEARCH DICTIONARY xsyn;
diff --git a/contrib/earthdistance/uninstall_earthdistance.sql b/contrib/earthdistance/uninstall_earthdistance.sql
index 95e4145642..dcad30ca57 100644
--- a/contrib/earthdistance/uninstall_earthdistance.sql
+++ b/contrib/earthdistance/uninstall_earthdistance.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP OPERATOR <@> (point, point);
diff --git a/contrib/fuzzystrmatch/fuzzystrmatch.sql.in b/contrib/fuzzystrmatch/fuzzystrmatch.sql.in
index b4e4fadc44..5160b9d7d5 100644
--- a/contrib/fuzzystrmatch/fuzzystrmatch.sql.in
+++ b/contrib/fuzzystrmatch/fuzzystrmatch.sql.in
@@ -1,30 +1,30 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-CREATE FUNCTION levenshtein (text,text) RETURNS int
+CREATE OR REPLACE FUNCTION levenshtein (text,text) RETURNS int
AS 'MODULE_PATHNAME','levenshtein'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION metaphone (text,int) RETURNS text
+CREATE OR REPLACE FUNCTION metaphone (text,int) RETURNS text
AS 'MODULE_PATHNAME','metaphone'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION soundex(text) RETURNS text
+CREATE OR REPLACE FUNCTION soundex(text) RETURNS text
AS 'MODULE_PATHNAME', 'soundex'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION text_soundex(text) RETURNS text
+CREATE OR REPLACE FUNCTION text_soundex(text) RETURNS text
AS 'MODULE_PATHNAME', 'soundex'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION difference(text,text) RETURNS int
+CREATE OR REPLACE FUNCTION difference(text,text) RETURNS int
AS 'MODULE_PATHNAME', 'difference'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION dmetaphone (text) RETURNS text
+CREATE OR REPLACE FUNCTION dmetaphone (text) RETURNS text
AS 'MODULE_PATHNAME', 'dmetaphone'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION dmetaphone_alt (text) RETURNS text
+CREATE OR REPLACE FUNCTION dmetaphone_alt (text) RETURNS text
AS 'MODULE_PATHNAME', 'dmetaphone_alt'
LANGUAGE C IMMUTABLE STRICT;
diff --git a/contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql b/contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql
index ee377e47b4..c2cfd815fc 100644
--- a/contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql
+++ b/contrib/fuzzystrmatch/uninstall_fuzzystrmatch.sql
@@ -1,4 +1,4 @@
--- Adjust this setting to control where the objects get created.
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION dmetaphone_alt (text);
diff --git a/contrib/hstore/hstore.sql.in b/contrib/hstore/hstore.sql.in
index 4687ac30f5..82cfebe1d0 100644
--- a/contrib/hstore/hstore.sql.in
+++ b/contrib/hstore/hstore.sql.in
@@ -1,15 +1,14 @@
+-- Adjust this setting to control where the objects get created.
SET search_path = public;
-BEGIN;
-
CREATE TYPE hstore;
-CREATE FUNCTION hstore_in(cstring)
+CREATE OR REPLACE FUNCTION hstore_in(cstring)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION hstore_out(hstore)
+CREATE OR REPLACE FUNCTION hstore_out(hstore)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -21,7 +20,7 @@ CREATE TYPE hstore (
STORAGE = extended
);
-CREATE FUNCTION fetchval(hstore,text)
+CREATE OR REPLACE FUNCTION fetchval(hstore,text)
RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -32,12 +31,12 @@ CREATE OPERATOR -> (
PROCEDURE = fetchval
);
-CREATE FUNCTION isexists(hstore,text)
+CREATE OR REPLACE FUNCTION isexists(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','exists'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION exist(hstore,text)
+CREATE OR REPLACE FUNCTION exist(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','exists'
LANGUAGE C STRICT IMMUTABLE;
@@ -50,22 +49,22 @@ CREATE OPERATOR ? (
JOIN = contjoinsel
);
-CREATE FUNCTION isdefined(hstore,text)
+CREATE OR REPLACE FUNCTION isdefined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','defined'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION defined(hstore,text)
+CREATE OR REPLACE FUNCTION defined(hstore,text)
RETURNS bool
AS 'MODULE_PATHNAME','defined'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION delete(hstore,text)
+CREATE OR REPLACE FUNCTION delete(hstore,text)
RETURNS hstore
AS 'MODULE_PATHNAME','delete'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION hs_concat(hstore,hstore)
+CREATE OR REPLACE FUNCTION hs_concat(hstore,hstore)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -76,12 +75,12 @@ CREATE OPERATOR || (
PROCEDURE = hs_concat
);
-CREATE FUNCTION hs_contains(hstore,hstore)
+CREATE OR REPLACE FUNCTION hs_contains(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION hs_contained(hstore,hstore)
+CREATE OR REPLACE FUNCTION hs_contained(hstore,hstore)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -123,7 +122,7 @@ CREATE OPERATOR ~ (
JOIN = contjoinsel
);
-CREATE FUNCTION tconvert(text,text)
+CREATE OR REPLACE FUNCTION tconvert(text,text)
RETURNS hstore
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -134,27 +133,27 @@ CREATE OPERATOR => (
PROCEDURE = tconvert
);
-CREATE FUNCTION akeys(hstore)
+CREATE OR REPLACE FUNCTION akeys(hstore)
RETURNS _text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION avals(hstore)
+CREATE OR REPLACE FUNCTION avals(hstore)
RETURNS _text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION skeys(hstore)
+CREATE OR REPLACE FUNCTION skeys(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION svals(hstore)
+CREATE OR REPLACE FUNCTION svals(hstore)
RETURNS setof text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION each(IN hs hstore,
+CREATE OR REPLACE FUNCTION each(IN hs hstore,
OUT key text,
OUT value text)
RETURNS SETOF record
@@ -167,12 +166,12 @@ LANGUAGE C STRICT IMMUTABLE;
CREATE TYPE ghstore;
-CREATE FUNCTION ghstore_in(cstring)
+CREATE OR REPLACE FUNCTION ghstore_in(cstring)
RETURNS ghstore
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION ghstore_out(ghstore)
+CREATE OR REPLACE FUNCTION ghstore_out(ghstore)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -183,37 +182,37 @@ CREATE TYPE ghstore (
OUTPUT = ghstore_out
);
-CREATE FUNCTION ghstore_compress(internal)
+CREATE OR REPLACE FUNCTION ghstore_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ghstore_decompress(internal)
+CREATE OR REPLACE FUNCTION ghstore_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ghstore_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION ghstore_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION ghstore_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION ghstore_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ghstore_union(internal, internal)
+CREATE OR REPLACE FUNCTION ghstore_union(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ghstore_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION ghstore_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ghstore_consistent(internal,internal,int4)
+CREATE OR REPLACE FUNCTION ghstore_consistent(internal,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -238,17 +237,17 @@ AS
-- define the GIN support methods
-CREATE FUNCTION gin_extract_hstore(internal, internal)
+CREATE OR REPLACE FUNCTION gin_extract_hstore(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gin_extract_hstore_query(internal, internal, int2)
+CREATE OR REPLACE FUNCTION gin_extract_hstore_query(internal, internal, int2)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gin_consistent_hstore(internal, int2, internal)
+CREATE OR REPLACE FUNCTION gin_consistent_hstore(internal, int2, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -263,6 +262,3 @@ AS
FUNCTION 3 gin_extract_hstore_query(internal, internal, int2),
FUNCTION 4 gin_consistent_hstore(internal, int2, internal),
STORAGE text;
-
-
-END;
diff --git a/contrib/hstore/uninstall_hstore.sql b/contrib/hstore/uninstall_hstore.sql
index 84be1b75ff..b9b14935b4 100644
--- a/contrib/hstore/uninstall_hstore.sql
+++ b/contrib/hstore/uninstall_hstore.sql
@@ -1,4 +1,5 @@
-BEGIN;
+-- Adjust this setting to control where the objects get dropped.
+SET search_path = public;
DROP OPERATOR CLASS gist_hstore_ops USING gist CASCADE;
DROP OPERATOR CLASS gin_hstore_ops USING gin CASCADE;
@@ -41,5 +42,3 @@ DROP FUNCTION gin_extract_hstore_query(internal, internal, smallint);
DROP TYPE hstore CASCADE;
DROP TYPE ghstore CASCADE;
-
-COMMIT;
diff --git a/contrib/intagg/uninstall_int_aggregate.sql b/contrib/intagg/uninstall_int_aggregate.sql
index a64d5e98cb..0cea499abc 100644
--- a/contrib/intagg/uninstall_int_aggregate.sql
+++ b/contrib/intagg/uninstall_int_aggregate.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION int_array_enum(int4[]);
diff --git a/contrib/intarray/_int.sql.in b/contrib/intarray/_int.sql.in
index 2388fb8cc4..811e776cfa 100644
--- a/contrib/intarray/_int.sql.in
+++ b/contrib/intarray/_int.sql.in
@@ -1,20 +1,17 @@
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
+
--
-- Create the user-defined type for the 1-D integer arrays (_int4)
--
--- Adjust this setting to control where the operators, functions, and
--- opclasses get created.
-SET search_path = public;
-
-BEGIN;
-
-- Query type
-CREATE FUNCTION bqarr_in(cstring)
+CREATE OR REPLACE FUNCTION bqarr_in(cstring)
RETURNS query_int
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION bqarr_out(query_int)
+CREATE OR REPLACE FUNCTION bqarr_out(query_int)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -26,20 +23,20 @@ CREATE TYPE query_int (
);
--only for debug
-CREATE FUNCTION querytree(query_int)
+CREATE OR REPLACE FUNCTION querytree(query_int)
RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION boolop(_int4, query_int)
+CREATE OR REPLACE FUNCTION boolop(_int4, query_int)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION boolop(_int4, query_int) IS 'boolean operation with array';
-CREATE FUNCTION rboolop(query_int, _int4)
+CREATE OR REPLACE FUNCTION rboolop(query_int, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -71,35 +68,35 @@ CREATE OPERATOR ~~ (
-- Comparison methods
-CREATE FUNCTION _int_contains(_int4, _int4)
+CREATE OR REPLACE FUNCTION _int_contains(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION _int_contains(_int4, _int4) IS 'contains';
-CREATE FUNCTION _int_contained(_int4, _int4)
+CREATE OR REPLACE FUNCTION _int_contained(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION _int_contained(_int4, _int4) IS 'contained in';
-CREATE FUNCTION _int_overlap(_int4, _int4)
+CREATE OR REPLACE FUNCTION _int_overlap(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION _int_overlap(_int4, _int4) IS 'overlaps';
-CREATE FUNCTION _int_same(_int4, _int4)
+CREATE OR REPLACE FUNCTION _int_same(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION _int_same(_int4, _int4) IS 'same as';
-CREATE FUNCTION _int_different(_int4, _int4)
+CREATE OR REPLACE FUNCTION _int_different(_int4, _int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -108,12 +105,12 @@ COMMENT ON FUNCTION _int_different(_int4, _int4) IS 'different';
-- support routines for indexing
-CREATE FUNCTION _int_union(_int4, _int4)
+CREATE OR REPLACE FUNCTION _int_union(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _int_inter(_int4, _int4)
+CREATE OR REPLACE FUNCTION _int_inter(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -191,12 +188,12 @@ CREATE OPERATOR ~ (
);
--------------
-CREATE FUNCTION intset(int4)
+CREATE OR REPLACE FUNCTION intset(int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION icount(_int4)
+CREATE OR REPLACE FUNCTION icount(_int4)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -206,32 +203,32 @@ CREATE OPERATOR # (
PROCEDURE = icount
);
-CREATE FUNCTION sort(_int4, text)
+CREATE OR REPLACE FUNCTION sort(_int4, text)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION sort(_int4)
+CREATE OR REPLACE FUNCTION sort(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION sort_asc(_int4)
+CREATE OR REPLACE FUNCTION sort_asc(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION sort_desc(_int4)
+CREATE OR REPLACE FUNCTION sort_desc(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION uniq(_int4)
+CREATE OR REPLACE FUNCTION uniq(_int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION idx(_int4, int4)
+CREATE OR REPLACE FUNCTION idx(_int4, int4)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -242,17 +239,17 @@ CREATE OPERATOR # (
PROCEDURE = idx
);
-CREATE FUNCTION subarray(_int4, int4, int4)
+CREATE OR REPLACE FUNCTION subarray(_int4, int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION subarray(_int4, int4)
+CREATE OR REPLACE FUNCTION subarray(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION intarray_push_elem(_int4, int4)
+CREATE OR REPLACE FUNCTION intarray_push_elem(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -263,7 +260,7 @@ CREATE OPERATOR + (
PROCEDURE = intarray_push_elem
);
-CREATE FUNCTION intarray_push_array(_int4, _int4)
+CREATE OR REPLACE FUNCTION intarray_push_array(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -275,7 +272,7 @@ CREATE OPERATOR + (
PROCEDURE = intarray_push_array
);
-CREATE FUNCTION intarray_del_elem(_int4, int4)
+CREATE OR REPLACE FUNCTION intarray_del_elem(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -286,7 +283,7 @@ CREATE OPERATOR - (
PROCEDURE = intarray_del_elem
);
-CREATE FUNCTION intset_union_elem(_int4, int4)
+CREATE OR REPLACE FUNCTION intset_union_elem(_int4, int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -304,7 +301,7 @@ CREATE OPERATOR | (
PROCEDURE = _int_union
);
-CREATE FUNCTION intset_subtract(_int4, _int4)
+CREATE OR REPLACE FUNCTION intset_subtract(_int4, _int4)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -324,37 +321,37 @@ CREATE OPERATOR & (
--------------
-- define the GiST support methods
-CREATE FUNCTION g_int_consistent(internal,_int4,int4)
+CREATE OR REPLACE FUNCTION g_int_consistent(internal,_int4,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_int_compress(internal)
+CREATE OR REPLACE FUNCTION g_int_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_int_decompress(internal)
+CREATE OR REPLACE FUNCTION g_int_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_int_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION g_int_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION g_int_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION g_int_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_int_union(internal, internal)
+CREATE OR REPLACE FUNCTION g_int_union(internal, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_int_same(_int4, _int4, internal)
+CREATE OR REPLACE FUNCTION g_int_same(_int4, _int4, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -385,12 +382,12 @@ DEFAULT FOR TYPE _int4 USING gist AS
---------------------------------------------
-- define the GiST support methods
-CREATE FUNCTION _intbig_in(cstring)
+CREATE OR REPLACE FUNCTION _intbig_in(cstring)
RETURNS intbig_gkey
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _intbig_out(intbig_gkey)
+CREATE OR REPLACE FUNCTION _intbig_out(intbig_gkey)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -401,37 +398,37 @@ CREATE TYPE intbig_gkey (
OUTPUT = _intbig_out
);
-CREATE FUNCTION g_intbig_consistent(internal,internal,int4)
+CREATE OR REPLACE FUNCTION g_intbig_consistent(internal,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_intbig_compress(internal)
+CREATE OR REPLACE FUNCTION g_intbig_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_intbig_decompress(internal)
+CREATE OR REPLACE FUNCTION g_intbig_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_intbig_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION g_intbig_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION g_intbig_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION g_intbig_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_intbig_union(internal, internal)
+CREATE OR REPLACE FUNCTION g_intbig_union(internal, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION g_intbig_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION g_intbig_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -459,12 +456,12 @@ AS
--GIN
-CREATE FUNCTION ginint4_queryextract(internal, internal, int2)
+CREATE OR REPLACE FUNCTION ginint4_queryextract(internal, internal, int2)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ginint4_consistent(internal, int2, internal)
+CREATE OR REPLACE FUNCTION ginint4_consistent(internal, int2, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -484,5 +481,3 @@ AS
FUNCTION 3 ginint4_queryextract (internal, internal, int2),
FUNCTION 4 ginint4_consistent (internal, int2, internal),
STORAGE int4;
-
-COMMIT;
diff --git a/contrib/intarray/uninstall__int.sql b/contrib/intarray/uninstall__int.sql
index cc3d44273a..34b47a0148 100644
--- a/contrib/intarray/uninstall__int.sql
+++ b/contrib/intarray/uninstall__int.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get created.
SET search_path = public;
DROP OPERATOR CLASS gin__int_ops USING gin;
diff --git a/contrib/isn/isn.sql.in b/contrib/isn/isn.sql.in
index 8defb924f4..1637e2228a 100644
--- a/contrib/isn/isn.sql.in
+++ b/contrib/isn/isn.sql.in
@@ -1,9 +1,6 @@
---
--- PostgreSQL code for ISNs (ISBN, ISMN, ISSN, EAN13, UPC)
--- Copyright (c) 2004-2006, German Mendez Bravo (Kronuz)
---
--- $PostgreSQL: pgsql/contrib/isn/isn.sql.in,v 1.6 2007/09/30 17:13:19 tgl Exp $
---
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
+
-- Example:
-- create table test ( id isbn );
-- insert into test values('978-0-393-04002-9');
@@ -12,21 +9,16 @@
-- select isbn13('0-901690-54-6');
--
--- Adjust this setting to control where the objects get created.
-SET search_path = public;
-
-BEGIN;
-
--
-- Input and output functions and data types:
--
---------------------------------------------------
-CREATE FUNCTION ean13_in(cstring)
+CREATE OR REPLACE FUNCTION ean13_in(cstring)
RETURNS ean13
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION ean13_out(ean13)
+CREATE OR REPLACE FUNCTION ean13_out(ean13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -41,12 +33,12 @@ CREATE TYPE ean13 (
COMMENT ON TYPE ean13
IS 'International European Article Number (EAN13)';
-CREATE FUNCTION isbn13_in(cstring)
+CREATE OR REPLACE FUNCTION isbn13_in(cstring)
RETURNS isbn13
AS 'MODULE_PATHNAME', 'isbn_in'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION ean13_out(isbn13)
+CREATE OR REPLACE FUNCTION ean13_out(isbn13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -61,12 +53,12 @@ CREATE TYPE isbn13 (
COMMENT ON TYPE isbn13
IS 'International Standard Book Number 13 (ISBN13)';
-CREATE FUNCTION ismn13_in(cstring)
+CREATE OR REPLACE FUNCTION ismn13_in(cstring)
RETURNS ismn13
AS 'MODULE_PATHNAME', 'ismn_in'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION ean13_out(ismn13)
+CREATE OR REPLACE FUNCTION ean13_out(ismn13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -81,12 +73,12 @@ CREATE TYPE ismn13 (
COMMENT ON TYPE ismn13
IS 'International Standard Music Number 13 (ISMN13)';
-CREATE FUNCTION issn13_in(cstring)
+CREATE OR REPLACE FUNCTION issn13_in(cstring)
RETURNS issn13
AS 'MODULE_PATHNAME', 'issn_in'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION ean13_out(issn13)
+CREATE OR REPLACE FUNCTION ean13_out(issn13)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -103,12 +95,12 @@ COMMENT ON TYPE issn13
-- Short format:
-CREATE FUNCTION isbn_in(cstring)
+CREATE OR REPLACE FUNCTION isbn_in(cstring)
RETURNS isbn
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION isn_out(isbn)
+CREATE OR REPLACE FUNCTION isn_out(isbn)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -123,12 +115,12 @@ CREATE TYPE isbn (
COMMENT ON TYPE isbn
IS 'International Standard Book Number (ISBN)';
-CREATE FUNCTION ismn_in(cstring)
+CREATE OR REPLACE FUNCTION ismn_in(cstring)
RETURNS ismn
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION isn_out(ismn)
+CREATE OR REPLACE FUNCTION isn_out(ismn)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -143,12 +135,12 @@ CREATE TYPE ismn (
COMMENT ON TYPE ismn
IS 'International Standard Music Number (ISMN)';
-CREATE FUNCTION issn_in(cstring)
+CREATE OR REPLACE FUNCTION issn_in(cstring)
RETURNS issn
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION isn_out(issn)
+CREATE OR REPLACE FUNCTION isn_out(issn)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -163,12 +155,12 @@ CREATE TYPE issn (
COMMENT ON TYPE issn
IS 'International Standard Serial Number (ISSN)';
-CREATE FUNCTION upc_in(cstring)
+CREATE OR REPLACE FUNCTION upc_in(cstring)
RETURNS upc
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION isn_out(upc)
+CREATE OR REPLACE FUNCTION isn_out(upc)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -188,249 +180,249 @@ COMMENT ON TYPE upc
--
---------------------------------------------------
-- EAN13:
-CREATE FUNCTION isnlt(ean13, ean13)
+CREATE OR REPLACE FUNCTION isnlt(ean13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, ean13)
+CREATE OR REPLACE FUNCTION isnle(ean13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, ean13)
+CREATE OR REPLACE FUNCTION isneq(ean13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, ean13)
+CREATE OR REPLACE FUNCTION isnge(ean13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, ean13)
+CREATE OR REPLACE FUNCTION isngt(ean13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, ean13)
+CREATE OR REPLACE FUNCTION isnne(ean13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ean13, isbn13)
+CREATE OR REPLACE FUNCTION isnlt(ean13, isbn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, isbn13)
+CREATE OR REPLACE FUNCTION isnle(ean13, isbn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, isbn13)
+CREATE OR REPLACE FUNCTION isneq(ean13, isbn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, isbn13)
+CREATE OR REPLACE FUNCTION isnge(ean13, isbn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, isbn13)
+CREATE OR REPLACE FUNCTION isngt(ean13, isbn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, isbn13)
+CREATE OR REPLACE FUNCTION isnne(ean13, isbn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ean13, ismn13)
+CREATE OR REPLACE FUNCTION isnlt(ean13, ismn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, ismn13)
+CREATE OR REPLACE FUNCTION isnle(ean13, ismn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, ismn13)
+CREATE OR REPLACE FUNCTION isneq(ean13, ismn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, ismn13)
+CREATE OR REPLACE FUNCTION isnge(ean13, ismn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, ismn13)
+CREATE OR REPLACE FUNCTION isngt(ean13, ismn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, ismn13)
+CREATE OR REPLACE FUNCTION isnne(ean13, ismn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ean13, issn13)
+CREATE OR REPLACE FUNCTION isnlt(ean13, issn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, issn13)
+CREATE OR REPLACE FUNCTION isnle(ean13, issn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, issn13)
+CREATE OR REPLACE FUNCTION isneq(ean13, issn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, issn13)
+CREATE OR REPLACE FUNCTION isnge(ean13, issn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, issn13)
+CREATE OR REPLACE FUNCTION isngt(ean13, issn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, issn13)
+CREATE OR REPLACE FUNCTION isnne(ean13, issn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ean13, isbn)
+CREATE OR REPLACE FUNCTION isnlt(ean13, isbn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, isbn)
+CREATE OR REPLACE FUNCTION isnle(ean13, isbn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, isbn)
+CREATE OR REPLACE FUNCTION isneq(ean13, isbn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, isbn)
+CREATE OR REPLACE FUNCTION isnge(ean13, isbn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, isbn)
+CREATE OR REPLACE FUNCTION isngt(ean13, isbn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, isbn)
+CREATE OR REPLACE FUNCTION isnne(ean13, isbn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ean13, ismn)
+CREATE OR REPLACE FUNCTION isnlt(ean13, ismn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, ismn)
+CREATE OR REPLACE FUNCTION isnle(ean13, ismn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, ismn)
+CREATE OR REPLACE FUNCTION isneq(ean13, ismn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, ismn)
+CREATE OR REPLACE FUNCTION isnge(ean13, ismn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, ismn)
+CREATE OR REPLACE FUNCTION isngt(ean13, ismn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, ismn)
+CREATE OR REPLACE FUNCTION isnne(ean13, ismn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ean13, issn)
+CREATE OR REPLACE FUNCTION isnlt(ean13, issn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, issn)
+CREATE OR REPLACE FUNCTION isnle(ean13, issn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, issn)
+CREATE OR REPLACE FUNCTION isneq(ean13, issn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, issn)
+CREATE OR REPLACE FUNCTION isnge(ean13, issn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, issn)
+CREATE OR REPLACE FUNCTION isngt(ean13, issn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, issn)
+CREATE OR REPLACE FUNCTION isnne(ean13, issn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ean13, upc)
+CREATE OR REPLACE FUNCTION isnlt(ean13, upc)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ean13, upc)
+CREATE OR REPLACE FUNCTION isnle(ean13, upc)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ean13, upc)
+CREATE OR REPLACE FUNCTION isneq(ean13, upc)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ean13, upc)
+CREATE OR REPLACE FUNCTION isnge(ean13, upc)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ean13, upc)
+CREATE OR REPLACE FUNCTION isngt(ean13, upc)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ean13, upc)
+CREATE OR REPLACE FUNCTION isnne(ean13, upc)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -438,94 +430,94 @@ CREATE FUNCTION isnne(ean13, upc)
---------------------------------------------------
-- ISBN13:
-CREATE FUNCTION isnlt(isbn13, isbn13)
+CREATE OR REPLACE FUNCTION isnlt(isbn13, isbn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(isbn13, isbn13)
+CREATE OR REPLACE FUNCTION isnle(isbn13, isbn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(isbn13, isbn13)
+CREATE OR REPLACE FUNCTION isneq(isbn13, isbn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(isbn13, isbn13)
+CREATE OR REPLACE FUNCTION isnge(isbn13, isbn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(isbn13, isbn13)
+CREATE OR REPLACE FUNCTION isngt(isbn13, isbn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(isbn13, isbn13)
+CREATE OR REPLACE FUNCTION isnne(isbn13, isbn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(isbn13, isbn)
+CREATE OR REPLACE FUNCTION isnlt(isbn13, isbn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(isbn13, isbn)
+CREATE OR REPLACE FUNCTION isnle(isbn13, isbn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(isbn13, isbn)
+CREATE OR REPLACE FUNCTION isneq(isbn13, isbn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(isbn13, isbn)
+CREATE OR REPLACE FUNCTION isnge(isbn13, isbn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(isbn13, isbn)
+CREATE OR REPLACE FUNCTION isngt(isbn13, isbn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(isbn13, isbn)
+CREATE OR REPLACE FUNCTION isnne(isbn13, isbn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(isbn13, ean13)
+CREATE OR REPLACE FUNCTION isnlt(isbn13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(isbn13, ean13)
+CREATE OR REPLACE FUNCTION isnle(isbn13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(isbn13, ean13)
+CREATE OR REPLACE FUNCTION isneq(isbn13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(isbn13, ean13)
+CREATE OR REPLACE FUNCTION isnge(isbn13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(isbn13, ean13)
+CREATE OR REPLACE FUNCTION isngt(isbn13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(isbn13, ean13)
+CREATE OR REPLACE FUNCTION isnne(isbn13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -533,94 +525,94 @@ CREATE FUNCTION isnne(isbn13, ean13)
---------------------------------------------------
-- ISBN:
-CREATE FUNCTION isnlt(isbn, isbn)
+CREATE OR REPLACE FUNCTION isnlt(isbn, isbn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(isbn, isbn)
+CREATE OR REPLACE FUNCTION isnle(isbn, isbn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(isbn, isbn)
+CREATE OR REPLACE FUNCTION isneq(isbn, isbn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(isbn, isbn)
+CREATE OR REPLACE FUNCTION isnge(isbn, isbn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(isbn, isbn)
+CREATE OR REPLACE FUNCTION isngt(isbn, isbn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(isbn, isbn)
+CREATE OR REPLACE FUNCTION isnne(isbn, isbn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(isbn, isbn13)
+CREATE OR REPLACE FUNCTION isnlt(isbn, isbn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(isbn, isbn13)
+CREATE OR REPLACE FUNCTION isnle(isbn, isbn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(isbn, isbn13)
+CREATE OR REPLACE FUNCTION isneq(isbn, isbn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(isbn, isbn13)
+CREATE OR REPLACE FUNCTION isnge(isbn, isbn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(isbn, isbn13)
+CREATE OR REPLACE FUNCTION isngt(isbn, isbn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(isbn, isbn13)
+CREATE OR REPLACE FUNCTION isnne(isbn, isbn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(isbn, ean13)
+CREATE OR REPLACE FUNCTION isnlt(isbn, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(isbn, ean13)
+CREATE OR REPLACE FUNCTION isnle(isbn, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(isbn, ean13)
+CREATE OR REPLACE FUNCTION isneq(isbn, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(isbn, ean13)
+CREATE OR REPLACE FUNCTION isnge(isbn, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(isbn, ean13)
+CREATE OR REPLACE FUNCTION isngt(isbn, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(isbn, ean13)
+CREATE OR REPLACE FUNCTION isnne(isbn, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -628,94 +620,94 @@ CREATE FUNCTION isnne(isbn, ean13)
---------------------------------------------------
-- ISMN13:
-CREATE FUNCTION isnlt(ismn13, ismn13)
+CREATE OR REPLACE FUNCTION isnlt(ismn13, ismn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ismn13, ismn13)
+CREATE OR REPLACE FUNCTION isnle(ismn13, ismn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ismn13, ismn13)
+CREATE OR REPLACE FUNCTION isneq(ismn13, ismn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ismn13, ismn13)
+CREATE OR REPLACE FUNCTION isnge(ismn13, ismn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ismn13, ismn13)
+CREATE OR REPLACE FUNCTION isngt(ismn13, ismn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ismn13, ismn13)
+CREATE OR REPLACE FUNCTION isnne(ismn13, ismn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ismn13, ismn)
+CREATE OR REPLACE FUNCTION isnlt(ismn13, ismn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ismn13, ismn)
+CREATE OR REPLACE FUNCTION isnle(ismn13, ismn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ismn13, ismn)
+CREATE OR REPLACE FUNCTION isneq(ismn13, ismn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ismn13, ismn)
+CREATE OR REPLACE FUNCTION isnge(ismn13, ismn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ismn13, ismn)
+CREATE OR REPLACE FUNCTION isngt(ismn13, ismn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ismn13, ismn)
+CREATE OR REPLACE FUNCTION isnne(ismn13, ismn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ismn13, ean13)
+CREATE OR REPLACE FUNCTION isnlt(ismn13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ismn13, ean13)
+CREATE OR REPLACE FUNCTION isnle(ismn13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ismn13, ean13)
+CREATE OR REPLACE FUNCTION isneq(ismn13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ismn13, ean13)
+CREATE OR REPLACE FUNCTION isnge(ismn13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ismn13, ean13)
+CREATE OR REPLACE FUNCTION isngt(ismn13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ismn13, ean13)
+CREATE OR REPLACE FUNCTION isnne(ismn13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -723,94 +715,94 @@ CREATE FUNCTION isnne(ismn13, ean13)
---------------------------------------------------
-- ISMN:
-CREATE FUNCTION isnlt(ismn, ismn)
+CREATE OR REPLACE FUNCTION isnlt(ismn, ismn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ismn, ismn)
+CREATE OR REPLACE FUNCTION isnle(ismn, ismn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ismn, ismn)
+CREATE OR REPLACE FUNCTION isneq(ismn, ismn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ismn, ismn)
+CREATE OR REPLACE FUNCTION isnge(ismn, ismn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ismn, ismn)
+CREATE OR REPLACE FUNCTION isngt(ismn, ismn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ismn, ismn)
+CREATE OR REPLACE FUNCTION isnne(ismn, ismn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ismn, ismn13)
+CREATE OR REPLACE FUNCTION isnlt(ismn, ismn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ismn, ismn13)
+CREATE OR REPLACE FUNCTION isnle(ismn, ismn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ismn, ismn13)
+CREATE OR REPLACE FUNCTION isneq(ismn, ismn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ismn, ismn13)
+CREATE OR REPLACE FUNCTION isnge(ismn, ismn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ismn, ismn13)
+CREATE OR REPLACE FUNCTION isngt(ismn, ismn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ismn, ismn13)
+CREATE OR REPLACE FUNCTION isnne(ismn, ismn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(ismn, ean13)
+CREATE OR REPLACE FUNCTION isnlt(ismn, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(ismn, ean13)
+CREATE OR REPLACE FUNCTION isnle(ismn, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(ismn, ean13)
+CREATE OR REPLACE FUNCTION isneq(ismn, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(ismn, ean13)
+CREATE OR REPLACE FUNCTION isnge(ismn, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(ismn, ean13)
+CREATE OR REPLACE FUNCTION isngt(ismn, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(ismn, ean13)
+CREATE OR REPLACE FUNCTION isnne(ismn, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -818,94 +810,94 @@ CREATE FUNCTION isnne(ismn, ean13)
---------------------------------------------------
-- ISSN13:
-CREATE FUNCTION isnlt(issn13, issn13)
+CREATE OR REPLACE FUNCTION isnlt(issn13, issn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(issn13, issn13)
+CREATE OR REPLACE FUNCTION isnle(issn13, issn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(issn13, issn13)
+CREATE OR REPLACE FUNCTION isneq(issn13, issn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(issn13, issn13)
+CREATE OR REPLACE FUNCTION isnge(issn13, issn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(issn13, issn13)
+CREATE OR REPLACE FUNCTION isngt(issn13, issn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(issn13, issn13)
+CREATE OR REPLACE FUNCTION isnne(issn13, issn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(issn13, issn)
+CREATE OR REPLACE FUNCTION isnlt(issn13, issn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(issn13, issn)
+CREATE OR REPLACE FUNCTION isnle(issn13, issn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(issn13, issn)
+CREATE OR REPLACE FUNCTION isneq(issn13, issn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(issn13, issn)
+CREATE OR REPLACE FUNCTION isnge(issn13, issn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(issn13, issn)
+CREATE OR REPLACE FUNCTION isngt(issn13, issn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(issn13, issn)
+CREATE OR REPLACE FUNCTION isnne(issn13, issn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(issn13, ean13)
+CREATE OR REPLACE FUNCTION isnlt(issn13, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(issn13, ean13)
+CREATE OR REPLACE FUNCTION isnle(issn13, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(issn13, ean13)
+CREATE OR REPLACE FUNCTION isneq(issn13, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(issn13, ean13)
+CREATE OR REPLACE FUNCTION isnge(issn13, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(issn13, ean13)
+CREATE OR REPLACE FUNCTION isngt(issn13, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(issn13, ean13)
+CREATE OR REPLACE FUNCTION isnne(issn13, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -913,94 +905,94 @@ CREATE FUNCTION isnne(issn13, ean13)
---------------------------------------------------
-- ISSN:
-CREATE FUNCTION isnlt(issn, issn)
+CREATE OR REPLACE FUNCTION isnlt(issn, issn)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(issn, issn)
+CREATE OR REPLACE FUNCTION isnle(issn, issn)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(issn, issn)
+CREATE OR REPLACE FUNCTION isneq(issn, issn)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(issn, issn)
+CREATE OR REPLACE FUNCTION isnge(issn, issn)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(issn, issn)
+CREATE OR REPLACE FUNCTION isngt(issn, issn)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(issn, issn)
+CREATE OR REPLACE FUNCTION isnne(issn, issn)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(issn, issn13)
+CREATE OR REPLACE FUNCTION isnlt(issn, issn13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(issn, issn13)
+CREATE OR REPLACE FUNCTION isnle(issn, issn13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(issn, issn13)
+CREATE OR REPLACE FUNCTION isneq(issn, issn13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(issn, issn13)
+CREATE OR REPLACE FUNCTION isnge(issn, issn13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(issn, issn13)
+CREATE OR REPLACE FUNCTION isngt(issn, issn13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(issn, issn13)
+CREATE OR REPLACE FUNCTION isnne(issn, issn13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(issn, ean13)
+CREATE OR REPLACE FUNCTION isnlt(issn, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(issn, ean13)
+CREATE OR REPLACE FUNCTION isnle(issn, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(issn, ean13)
+CREATE OR REPLACE FUNCTION isneq(issn, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(issn, ean13)
+CREATE OR REPLACE FUNCTION isnge(issn, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(issn, ean13)
+CREATE OR REPLACE FUNCTION isngt(issn, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(issn, ean13)
+CREATE OR REPLACE FUNCTION isnne(issn, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -1008,63 +1000,63 @@ CREATE FUNCTION isnne(issn, ean13)
---------------------------------------------------
-- UPC:
-CREATE FUNCTION isnlt(upc, upc)
+CREATE OR REPLACE FUNCTION isnlt(upc, upc)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(upc, upc)
+CREATE OR REPLACE FUNCTION isnle(upc, upc)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(upc, upc)
+CREATE OR REPLACE FUNCTION isneq(upc, upc)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(upc, upc)
+CREATE OR REPLACE FUNCTION isnge(upc, upc)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(upc, upc)
+CREATE OR REPLACE FUNCTION isngt(upc, upc)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(upc, upc)
+CREATE OR REPLACE FUNCTION isnne(upc, upc)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnlt(upc, ean13)
+CREATE OR REPLACE FUNCTION isnlt(upc, ean13)
RETURNS boolean
AS 'int8lt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnle(upc, ean13)
+CREATE OR REPLACE FUNCTION isnle(upc, ean13)
RETURNS boolean
AS 'int8le'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isneq(upc, ean13)
+CREATE OR REPLACE FUNCTION isneq(upc, ean13)
RETURNS boolean
AS 'int8eq'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnge(upc, ean13)
+CREATE OR REPLACE FUNCTION isnge(upc, ean13)
RETURNS boolean
AS 'int8ge'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isngt(upc, ean13)
+CREATE OR REPLACE FUNCTION isngt(upc, ean13)
RETURNS boolean
AS 'int8gt'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION isnne(upc, ean13)
+CREATE OR REPLACE FUNCTION isnne(upc, ean13)
RETURNS boolean
AS 'int8ne'
LANGUAGE 'internal'
@@ -2547,7 +2539,7 @@ CREATE OPERATOR FAMILY isn_ops USING hash;
--
---------------------------------------------------
-- EAN13:
-CREATE FUNCTION btean13cmp(ean13, ean13)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2562,7 +2554,7 @@ CREATE OPERATOR CLASS ean13_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btean13cmp(ean13, ean13);
-CREATE FUNCTION hashean13(ean13)
+CREATE OR REPLACE FUNCTION hashean13(ean13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal' IMMUTABLE STRICT;
@@ -2573,37 +2565,37 @@ CREATE OPERATOR CLASS ean13_ops DEFAULT
FUNCTION 1 hashean13(ean13);
-- EAN13 vs other types:
-CREATE FUNCTION btean13cmp(ean13, isbn13)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, isbn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btean13cmp(ean13, ismn13)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, ismn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btean13cmp(ean13, issn13)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, issn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btean13cmp(ean13, isbn)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, isbn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btean13cmp(ean13, ismn)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, ismn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btean13cmp(ean13, issn)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, issn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btean13cmp(ean13, upc)
+CREATE OR REPLACE FUNCTION btean13cmp(ean13, upc)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2664,7 +2656,7 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
---------------------------------------------------
-- ISBN13:
-CREATE FUNCTION btisbn13cmp(isbn13, isbn13)
+CREATE OR REPLACE FUNCTION btisbn13cmp(isbn13, isbn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2679,7 +2671,7 @@ CREATE OPERATOR CLASS isbn13_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btisbn13cmp(isbn13, isbn13);
-CREATE FUNCTION hashisbn13(isbn13)
+CREATE OR REPLACE FUNCTION hashisbn13(isbn13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
@@ -2691,12 +2683,12 @@ CREATE OPERATOR CLASS isbn13_ops DEFAULT
FUNCTION 1 hashisbn13(isbn13);
-- ISBN13 vs other types:
-CREATE FUNCTION btisbn13cmp(isbn13, ean13)
+CREATE OR REPLACE FUNCTION btisbn13cmp(isbn13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btisbn13cmp(isbn13, isbn)
+CREATE OR REPLACE FUNCTION btisbn13cmp(isbn13, isbn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2722,7 +2714,7 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
---------------------------------------------------
-- ISBN:
-CREATE FUNCTION btisbncmp(isbn, isbn)
+CREATE OR REPLACE FUNCTION btisbncmp(isbn, isbn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2737,7 +2729,7 @@ CREATE OPERATOR CLASS isbn_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btisbncmp(isbn, isbn);
-CREATE FUNCTION hashisbn(isbn)
+CREATE OR REPLACE FUNCTION hashisbn(isbn)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
@@ -2749,12 +2741,12 @@ CREATE OPERATOR CLASS isbn_ops DEFAULT
FUNCTION 1 hashisbn(isbn);
-- ISBN vs other types:
-CREATE FUNCTION btisbncmp(isbn, ean13)
+CREATE OR REPLACE FUNCTION btisbncmp(isbn, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btisbncmp(isbn, isbn13)
+CREATE OR REPLACE FUNCTION btisbncmp(isbn, isbn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2780,7 +2772,7 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
---------------------------------------------------
-- ISMN13:
-CREATE FUNCTION btismn13cmp(ismn13, ismn13)
+CREATE OR REPLACE FUNCTION btismn13cmp(ismn13, ismn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2795,7 +2787,7 @@ CREATE OPERATOR CLASS ismn13_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btismn13cmp(ismn13, ismn13);
-CREATE FUNCTION hashismn13(ismn13)
+CREATE OR REPLACE FUNCTION hashismn13(ismn13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
@@ -2807,12 +2799,12 @@ CREATE OPERATOR CLASS ismn13_ops DEFAULT
FUNCTION 1 hashismn13(ismn13);
-- ISMN13 vs other types:
-CREATE FUNCTION btismn13cmp(ismn13, ean13)
+CREATE OR REPLACE FUNCTION btismn13cmp(ismn13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btismn13cmp(ismn13, ismn)
+CREATE OR REPLACE FUNCTION btismn13cmp(ismn13, ismn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2838,7 +2830,7 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
---------------------------------------------------
-- ISMN:
-CREATE FUNCTION btismncmp(ismn, ismn)
+CREATE OR REPLACE FUNCTION btismncmp(ismn, ismn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2853,7 +2845,7 @@ CREATE OPERATOR CLASS ismn_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btismncmp(ismn, ismn);
-CREATE FUNCTION hashismn(ismn)
+CREATE OR REPLACE FUNCTION hashismn(ismn)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
@@ -2865,12 +2857,12 @@ CREATE OPERATOR CLASS ismn_ops DEFAULT
FUNCTION 1 hashismn(ismn);
-- ISMN vs other types:
-CREATE FUNCTION btismncmp(ismn, ean13)
+CREATE OR REPLACE FUNCTION btismncmp(ismn, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btismncmp(ismn, ismn13)
+CREATE OR REPLACE FUNCTION btismncmp(ismn, ismn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2896,7 +2888,7 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
---------------------------------------------------
-- ISSN13:
-CREATE FUNCTION btissn13cmp(issn13, issn13)
+CREATE OR REPLACE FUNCTION btissn13cmp(issn13, issn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2911,7 +2903,7 @@ CREATE OPERATOR CLASS issn13_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btissn13cmp(issn13, issn13);
-CREATE FUNCTION hashissn13(issn13)
+CREATE OR REPLACE FUNCTION hashissn13(issn13)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
@@ -2923,12 +2915,12 @@ CREATE OPERATOR CLASS issn13_ops DEFAULT
FUNCTION 1 hashissn13(issn13);
-- ISSN13 vs other types:
-CREATE FUNCTION btissn13cmp(issn13, ean13)
+CREATE OR REPLACE FUNCTION btissn13cmp(issn13, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btissn13cmp(issn13, issn)
+CREATE OR REPLACE FUNCTION btissn13cmp(issn13, issn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2954,7 +2946,7 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
---------------------------------------------------
-- ISSN:
-CREATE FUNCTION btissncmp(issn, issn)
+CREATE OR REPLACE FUNCTION btissncmp(issn, issn)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -2969,7 +2961,7 @@ CREATE OPERATOR CLASS issn_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btissncmp(issn, issn);
-CREATE FUNCTION hashissn(issn)
+CREATE OR REPLACE FUNCTION hashissn(issn)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
@@ -2981,12 +2973,12 @@ CREATE OPERATOR CLASS issn_ops DEFAULT
FUNCTION 1 hashissn(issn);
-- ISSN vs other types:
-CREATE FUNCTION btissncmp(issn, ean13)
+CREATE OR REPLACE FUNCTION btissncmp(issn, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
IMMUTABLE STRICT;
-CREATE FUNCTION btissncmp(issn, issn13)
+CREATE OR REPLACE FUNCTION btissncmp(issn, issn13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -3012,7 +3004,7 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
---------------------------------------------------
-- UPC:
-CREATE FUNCTION btupccmp(upc, upc)
+CREATE OR REPLACE FUNCTION btupccmp(upc, upc)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -3027,7 +3019,7 @@ CREATE OPERATOR CLASS upc_ops DEFAULT
OPERATOR 5 >,
FUNCTION 1 btupccmp(upc, upc);
-CREATE FUNCTION hashupc(upc)
+CREATE OR REPLACE FUNCTION hashupc(upc)
RETURNS int4
AS 'hashint8'
LANGUAGE 'internal'
@@ -3039,7 +3031,7 @@ CREATE OPERATOR CLASS upc_ops DEFAULT
FUNCTION 1 hashupc(upc);
-- UPC vs other types:
-CREATE FUNCTION btupccmp(upc, ean13)
+CREATE OR REPLACE FUNCTION btupccmp(upc, ean13)
RETURNS int4
AS 'btint8cmp'
LANGUAGE 'internal'
@@ -3060,31 +3052,31 @@ ALTER OPERATOR FAMILY isn_ops USING hash ADD
-- Type casts:
--
---------------------------------------------------
-CREATE FUNCTION isbn13(ean13)
+CREATE OR REPLACE FUNCTION isbn13(ean13)
RETURNS isbn13
AS 'MODULE_PATHNAME', 'isbn_cast_from_ean13'
LANGUAGE 'C' IMMUTABLE STRICT;
-CREATE FUNCTION ismn13(ean13)
+CREATE OR REPLACE FUNCTION ismn13(ean13)
RETURNS ismn13
AS 'MODULE_PATHNAME', 'ismn_cast_from_ean13'
LANGUAGE 'C' IMMUTABLE STRICT;
-CREATE FUNCTION issn13(ean13)
+CREATE OR REPLACE FUNCTION issn13(ean13)
RETURNS issn13
AS 'MODULE_PATHNAME', 'issn_cast_from_ean13'
LANGUAGE 'C' IMMUTABLE STRICT;
-CREATE FUNCTION isbn(ean13)
+CREATE OR REPLACE FUNCTION isbn(ean13)
RETURNS isbn
AS 'MODULE_PATHNAME', 'isbn_cast_from_ean13'
LANGUAGE 'C' IMMUTABLE STRICT;
-CREATE FUNCTION ismn(ean13)
+CREATE OR REPLACE FUNCTION ismn(ean13)
RETURNS ismn
AS 'MODULE_PATHNAME', 'ismn_cast_from_ean13'
LANGUAGE 'C' IMMUTABLE STRICT;
-CREATE FUNCTION issn(ean13)
+CREATE OR REPLACE FUNCTION issn(ean13)
RETURNS issn
AS 'MODULE_PATHNAME', 'issn_cast_from_ean13'
LANGUAGE 'C' IMMUTABLE STRICT;
-CREATE FUNCTION upc(ean13)
+CREATE OR REPLACE FUNCTION upc(ean13)
RETURNS upc
AS 'MODULE_PATHNAME', 'upc_cast_from_ean13'
LANGUAGE 'C' IMMUTABLE STRICT;
@@ -3116,83 +3108,83 @@ CREATE CAST (issn13 AS issn) WITHOUT FUNCTION AS ASSIGNMENT;
--
-- Validation stuff for lose types:
--
-CREATE FUNCTION make_valid(ean13)
+CREATE OR REPLACE FUNCTION make_valid(ean13)
RETURNS ean13
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION make_valid(isbn13)
+CREATE OR REPLACE FUNCTION make_valid(isbn13)
RETURNS isbn13
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION make_valid(ismn13)
+CREATE OR REPLACE FUNCTION make_valid(ismn13)
RETURNS ismn13
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION make_valid(issn13)
+CREATE OR REPLACE FUNCTION make_valid(issn13)
RETURNS issn13
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION make_valid(isbn)
+CREATE OR REPLACE FUNCTION make_valid(isbn)
RETURNS isbn
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION make_valid(ismn)
+CREATE OR REPLACE FUNCTION make_valid(ismn)
RETURNS ismn
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION make_valid(issn)
+CREATE OR REPLACE FUNCTION make_valid(issn)
RETURNS issn
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION make_valid(upc)
+CREATE OR REPLACE FUNCTION make_valid(upc)
RETURNS upc
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(ean13)
+CREATE OR REPLACE FUNCTION is_valid(ean13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(isbn13)
+CREATE OR REPLACE FUNCTION is_valid(isbn13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(ismn13)
+CREATE OR REPLACE FUNCTION is_valid(ismn13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(issn13)
+CREATE OR REPLACE FUNCTION is_valid(issn13)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(isbn)
+CREATE OR REPLACE FUNCTION is_valid(isbn)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(ismn)
+CREATE OR REPLACE FUNCTION is_valid(ismn)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(issn)
+CREATE OR REPLACE FUNCTION is_valid(issn)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
IMMUTABLE STRICT;
-CREATE FUNCTION is_valid(upc)
+CREATE OR REPLACE FUNCTION is_valid(upc)
RETURNS boolean
AS 'MODULE_PATHNAME'
LANGUAGE 'C'
@@ -3202,7 +3194,7 @@ CREATE FUNCTION is_valid(upc)
-- isn_weak(boolean) - Sets the weak input mode.
-- This function is intended for testing use only!
--
-CREATE FUNCTION isn_weak(boolean)
+CREATE OR REPLACE FUNCTION isn_weak(boolean)
RETURNS boolean
AS 'MODULE_PATHNAME', 'accept_weak_input'
LANGUAGE 'C'
@@ -3211,10 +3203,8 @@ CREATE FUNCTION isn_weak(boolean)
--
-- isn_weak() - Gets the weak input mode status
--
-CREATE FUNCTION isn_weak()
+CREATE OR REPLACE FUNCTION isn_weak()
RETURNS boolean
AS 'MODULE_PATHNAME', 'weak_input_status'
LANGUAGE 'C'
IMMUTABLE STRICT;
-
-COMMIT;
diff --git a/contrib/isn/uninstall_isn.sql b/contrib/isn/uninstall_isn.sql
index 529aca319f..973e214d0a 100644
--- a/contrib/isn/uninstall_isn.sql
+++ b/contrib/isn/uninstall_isn.sql
@@ -1,9 +1,9 @@
+-- Adjust this setting to control where the objects get dropped.
+SET search_path = public;
+
--
-- Drop the actual types (in cascade):
--
----------------------------------------------------
-SET search_path = public;
-
DROP TYPE ean13 CASCADE;
DROP TYPE isbn13 CASCADE;
DROP TYPE ismn13 CASCADE;
diff --git a/contrib/lo/lo.sql.in b/contrib/lo/lo.sql.in
index 5bf1c7e649..73e2b3d3c6 100644
--- a/contrib/lo/lo.sql.in
+++ b/contrib/lo/lo.sql.in
@@ -1,9 +1,3 @@
---
--- PostgreSQL code for managed Large Objects
---
--- $PostgreSQL: pgsql/contrib/lo/lo.sql.in,v 1.13 2005/06/23 00:06:37 tgl Exp $
---
-
-- Adjust this setting to control where the objects get created.
SET search_path = public;
@@ -19,11 +13,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 FUNCTION lo_oid(lo) RETURNS pg_catalog.oid AS
+CREATE OR REPLACE FUNCTION lo_oid(lo) RETURNS pg_catalog.oid AS
'SELECT $1::pg_catalog.oid' LANGUAGE SQL STRICT IMMUTABLE;
-- This is used in triggers
-CREATE FUNCTION lo_manage()
+CREATE OR REPLACE FUNCTION lo_manage()
RETURNS pg_catalog.trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;
diff --git a/contrib/lo/lo_test.sql b/contrib/lo/lo_test.sql
index ba4eca55b8..454c60f3bb 100644
--- a/contrib/lo/lo_test.sql
+++ b/contrib/lo/lo_test.sql
@@ -1,3 +1,6 @@
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
+
--
-- This runs some common tests against the type
--
diff --git a/contrib/lo/uninstall_lo.sql b/contrib/lo/uninstall_lo.sql
index de0281fabd..7c4059ae3a 100644
--- a/contrib/lo/uninstall_lo.sql
+++ b/contrib/lo/uninstall_lo.sql
@@ -1,11 +1,11 @@
+-- Adjust this setting to control where the objects get dropped.
+SET search_path = public;
+
--
-- This removes the LO type
-- It's used just for development
--
--- Adjust this setting to control where the objects get created.
-SET search_path = public;
-
-- drop the type and associated functions
DROP TYPE lo CASCADE;
diff --git a/contrib/ltree/ltree.sql.in b/contrib/ltree/ltree.sql.in
index 5fb25def9b..58212d0a0b 100644
--- a/contrib/ltree/ltree.sql.in
+++ b/contrib/ltree/ltree.sql.in
@@ -1,12 +1,12 @@
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-CREATE FUNCTION ltree_in(cstring)
+CREATE OR REPLACE FUNCTION ltree_in(cstring)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION ltree_out(ltree)
+CREATE OR REPLACE FUNCTION ltree_out(ltree)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -20,37 +20,37 @@ CREATE TYPE ltree (
--Compare function for ltree
-CREATE FUNCTION ltree_cmp(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_cmp(ltree,ltree)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_lt(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_lt(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_le(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_le(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_eq(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_eq(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_ge(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_ge(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_gt(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_gt(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_ne(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_ne(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -120,112 +120,112 @@ CREATE OPERATOR <> (
--util functions
-CREATE FUNCTION subltree(ltree,int4,int4)
+CREATE OR REPLACE FUNCTION subltree(ltree,int4,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION subpath(ltree,int4,int4)
+CREATE OR REPLACE FUNCTION subpath(ltree,int4,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION subpath(ltree,int4)
+CREATE OR REPLACE FUNCTION subpath(ltree,int4)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION index(ltree,ltree)
+CREATE OR REPLACE FUNCTION index(ltree,ltree)
RETURNS int4
AS 'MODULE_PATHNAME', 'ltree_index'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION index(ltree,ltree,int4)
+CREATE OR REPLACE FUNCTION index(ltree,ltree,int4)
RETURNS int4
AS 'MODULE_PATHNAME', 'ltree_index'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION nlevel(ltree)
+CREATE OR REPLACE FUNCTION nlevel(ltree)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree2text(ltree)
+CREATE OR REPLACE FUNCTION ltree2text(ltree)
RETURNS text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION text2ltree(text)
+CREATE OR REPLACE FUNCTION text2ltree(text)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(_ltree)
+CREATE OR REPLACE FUNCTION lca(_ltree)
RETURNS ltree
AS 'MODULE_PATHNAME','_lca'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(ltree,ltree)
+CREATE OR REPLACE FUNCTION lca(ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(ltree,ltree,ltree)
+CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(ltree,ltree,ltree,ltree)
+CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree)
+CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree)
+CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree)
+CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree,ltree)
+CREATE OR REPLACE FUNCTION lca(ltree,ltree,ltree,ltree,ltree,ltree,ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_isparent(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_isparent(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_risparent(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_risparent(ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_addltree(ltree,ltree)
+CREATE OR REPLACE FUNCTION ltree_addltree(ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_addtext(ltree,text)
+CREATE OR REPLACE FUNCTION ltree_addtext(ltree,text)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltree_textadd(text,ltree)
+CREATE OR REPLACE FUNCTION ltree_textadd(text,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltreeparentsel(internal, oid, internal, integer)
+CREATE OR REPLACE FUNCTION ltreeparentsel(internal, oid, internal, integer)
RETURNS float8
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -298,12 +298,12 @@ CREATE OPERATOR CLASS ltree_ops
--lquery type
-CREATE FUNCTION lquery_in(cstring)
+CREATE OR REPLACE FUNCTION lquery_in(cstring)
RETURNS lquery
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION lquery_out(lquery)
+CREATE OR REPLACE FUNCTION lquery_out(lquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -315,12 +315,12 @@ CREATE TYPE lquery (
STORAGE = extended
);
-CREATE FUNCTION ltq_regex(ltree,lquery)
+CREATE OR REPLACE FUNCTION ltq_regex(ltree,lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltq_rregex(lquery,ltree)
+CREATE OR REPLACE FUNCTION ltq_rregex(lquery,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -362,12 +362,12 @@ CREATE OPERATOR ^~ (
JOIN = contjoinsel
);
-CREATE FUNCTION lt_q_regex(ltree,_lquery)
+CREATE OR REPLACE FUNCTION lt_q_regex(ltree,_lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION lt_q_rregex(_lquery,ltree)
+CREATE OR REPLACE FUNCTION lt_q_rregex(_lquery,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -409,12 +409,12 @@ CREATE OPERATOR ^? (
JOIN = contjoinsel
);
-CREATE FUNCTION ltxtq_in(cstring)
+CREATE OR REPLACE FUNCTION ltxtq_in(cstring)
RETURNS ltxtquery
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION ltxtq_out(ltxtquery)
+CREATE OR REPLACE FUNCTION ltxtq_out(ltxtquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -428,12 +428,12 @@ CREATE TYPE ltxtquery (
-- operations WITH ltxtquery
-CREATE FUNCTION ltxtq_exec(ltree, ltxtquery)
+CREATE OR REPLACE FUNCTION ltxtq_exec(ltree, ltxtquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION ltxtq_rexec(ltxtquery, ltree)
+CREATE OR REPLACE FUNCTION ltxtq_rexec(ltxtquery, ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -476,12 +476,12 @@ CREATE OPERATOR ^@ (
);
--GiST support for ltree
-CREATE FUNCTION ltree_gist_in(cstring)
+CREATE OR REPLACE FUNCTION ltree_gist_in(cstring)
RETURNS ltree_gist
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION ltree_gist_out(ltree_gist)
+CREATE OR REPLACE FUNCTION ltree_gist_out(ltree_gist)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -494,25 +494,25 @@ CREATE TYPE ltree_gist (
);
-CREATE FUNCTION ltree_consistent(internal,internal,int2)
+CREATE OR REPLACE FUNCTION ltree_consistent(internal,internal,int2)
RETURNS bool as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ltree_compress(internal)
+CREATE OR REPLACE FUNCTION ltree_compress(internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ltree_decompress(internal)
+CREATE OR REPLACE FUNCTION ltree_decompress(internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ltree_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION ltree_penalty(internal,internal,internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION ltree_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION ltree_picksplit(internal, internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ltree_union(internal, internal)
+CREATE OR REPLACE FUNCTION ltree_union(internal, internal)
RETURNS int4 as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
-CREATE FUNCTION ltree_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION ltree_same(internal, internal, internal)
RETURNS internal as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
CREATE OPERATOR CLASS gist_ltree_ops
@@ -542,52 +542,52 @@ CREATE OPERATOR CLASS gist_ltree_ops
-- arrays of ltree
-CREATE FUNCTION _ltree_isparent(_ltree,ltree)
+CREATE OR REPLACE FUNCTION _ltree_isparent(_ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _ltree_r_isparent(ltree,_ltree)
+CREATE OR REPLACE FUNCTION _ltree_r_isparent(ltree,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _ltree_risparent(_ltree,ltree)
+CREATE OR REPLACE FUNCTION _ltree_risparent(_ltree,ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _ltree_r_risparent(ltree,_ltree)
+CREATE OR REPLACE FUNCTION _ltree_r_risparent(ltree,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _ltq_regex(_ltree,lquery)
+CREATE OR REPLACE FUNCTION _ltq_regex(_ltree,lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _ltq_rregex(lquery,_ltree)
+CREATE OR REPLACE FUNCTION _ltq_rregex(lquery,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _lt_q_regex(_ltree,_lquery)
+CREATE OR REPLACE FUNCTION _lt_q_regex(_ltree,_lquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _lt_q_rregex(_lquery,_ltree)
+CREATE OR REPLACE FUNCTION _lt_q_rregex(_lquery,_ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _ltxtq_exec(_ltree, ltxtquery)
+CREATE OR REPLACE FUNCTION _ltxtq_exec(_ltree, ltxtquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION _ltxtq_rexec(ltxtquery, _ltree)
+CREATE OR REPLACE FUNCTION _ltxtq_rexec(ltxtquery, _ltree)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -775,7 +775,7 @@ CREATE OPERATOR ^@ (
);
--extractors
-CREATE FUNCTION _ltree_extract_isparent(_ltree,ltree)
+CREATE OR REPLACE FUNCTION _ltree_extract_isparent(_ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -786,7 +786,7 @@ CREATE OPERATOR ?@> (
PROCEDURE = _ltree_extract_isparent
);
-CREATE FUNCTION _ltree_extract_risparent(_ltree,ltree)
+CREATE OR REPLACE FUNCTION _ltree_extract_risparent(_ltree,ltree)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -797,7 +797,7 @@ CREATE OPERATOR ?<@ (
PROCEDURE = _ltree_extract_risparent
);
-CREATE FUNCTION _ltq_extract_regex(_ltree,lquery)
+CREATE OR REPLACE FUNCTION _ltq_extract_regex(_ltree,lquery)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -808,7 +808,7 @@ CREATE OPERATOR ?~ (
PROCEDURE = _ltq_extract_regex
);
-CREATE FUNCTION _ltxtq_extract_exec(_ltree,ltxtquery)
+CREATE OR REPLACE FUNCTION _ltxtq_extract_exec(_ltree,ltxtquery)
RETURNS ltree
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -820,32 +820,32 @@ CREATE OPERATOR ?@ (
);
--GiST support for ltree[]
-CREATE FUNCTION _ltree_consistent(internal,internal,int2)
+CREATE OR REPLACE FUNCTION _ltree_consistent(internal,internal,int2)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION _ltree_compress(internal)
+CREATE OR REPLACE FUNCTION _ltree_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION _ltree_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION _ltree_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-CREATE FUNCTION _ltree_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION _ltree_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION _ltree_union(internal, internal)
+CREATE OR REPLACE FUNCTION _ltree_union(internal, internal)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION _ltree_same(internal, internal, internal)
+CREATE OR REPLACE FUNCTION _ltree_same(internal, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
diff --git a/contrib/ltree/ltreetest.sql b/contrib/ltree/ltreetest.sql
index eea5c475ee..4df3eae9f9 100644
--- a/contrib/ltree/ltreetest.sql
+++ b/contrib/ltree/ltreetest.sql
@@ -1,3 +1,6 @@
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
+
CREATE TABLE test ( path ltree);
INSERT INTO test VALUES ('Top');
INSERT INTO test VALUES ('Top.Science');
diff --git a/contrib/ltree/uninstall_ltree.sql b/contrib/ltree/uninstall_ltree.sql
index a409ea4fef..4f774329af 100644
--- a/contrib/ltree/uninstall_ltree.sql
+++ b/contrib/ltree/uninstall_ltree.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP OPERATOR CLASS gist__ltree_ops USING gist;
diff --git a/contrib/pageinspect/uninstall_pageinspect.sql b/contrib/pageinspect/uninstall_pageinspect.sql
index 848f01e8f8..ceb8e84578 100644
--- a/contrib/pageinspect/uninstall_pageinspect.sql
+++ b/contrib/pageinspect/uninstall_pageinspect.sql
@@ -1,4 +1,4 @@
--- Adjust this setting to control where the objects get created.
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION get_raw_page(text, int4);
diff --git a/contrib/pg_buffercache/pg_buffercache.sql.in b/contrib/pg_buffercache/pg_buffercache.sql.in
index a96b5d91f6..6ee320767a 100644
--- a/contrib/pg_buffercache/pg_buffercache.sql.in
+++ b/contrib/pg_buffercache/pg_buffercache.sql.in
@@ -1,5 +1,4 @@
-- Adjust this setting to control where the objects get created.
-BEGIN;
SET search_path = public;
-- Register the function.
@@ -17,5 +16,3 @@ CREATE VIEW pg_buffercache AS
-- Don't want these to be available at public.
REVOKE ALL ON FUNCTION pg_buffercache_pages() FROM PUBLIC;
REVOKE ALL ON pg_buffercache FROM PUBLIC;
-
-COMMIT;
diff --git a/contrib/pg_buffercache/uninstall_pg_buffercache.sql b/contrib/pg_buffercache/uninstall_pg_buffercache.sql
index 4c0c25ad79..601e8878bf 100644
--- a/contrib/pg_buffercache/uninstall_pg_buffercache.sql
+++ b/contrib/pg_buffercache/uninstall_pg_buffercache.sql
@@ -1,4 +1,4 @@
--- Adjust this setting to control where the objects get created.
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP VIEW pg_buffercache;
diff --git a/contrib/pg_freespacemap/pg_freespacemap.sql.in b/contrib/pg_freespacemap/pg_freespacemap.sql.in
index a91a991502..36e8e93f8c 100644
--- a/contrib/pg_freespacemap/pg_freespacemap.sql.in
+++ b/contrib/pg_freespacemap/pg_freespacemap.sql.in
@@ -1,5 +1,4 @@
-- Adjust this setting to control where the objects get created.
-BEGIN;
SET search_path = public;
@@ -41,5 +40,3 @@ REVOKE ALL ON pg_freespacemap_pages FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_freespacemap_relations() FROM PUBLIC;
REVOKE ALL ON pg_freespacemap_relations FROM PUBLIC;
-
-COMMIT;
diff --git a/contrib/pg_freespacemap/uninstall_pg_freespacemap.sql b/contrib/pg_freespacemap/uninstall_pg_freespacemap.sql
index d332f08b33..70b65098f6 100644
--- a/contrib/pg_freespacemap/uninstall_pg_freespacemap.sql
+++ b/contrib/pg_freespacemap/uninstall_pg_freespacemap.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP VIEW pg_freespacemap_pages;
diff --git a/contrib/pg_trgm/pg_trgm.sql.in b/contrib/pg_trgm/pg_trgm.sql.in
index 14efebf609..f876dac87f 100644
--- a/contrib/pg_trgm/pg_trgm.sql.in
+++ b/contrib/pg_trgm/pg_trgm.sql.in
@@ -1,29 +1,28 @@
+-- Adjust this setting to control where the objects get created.
SET search_path = public;
-BEGIN;
-
-create function set_limit(float4)
-returns float4
+CREATE OR REPLACE FUNCTION set_limit(float4)
+RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-create function show_limit()
-returns float4
+CREATE OR REPLACE FUNCTION show_limit()
+RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-create function show_trgm(text)
-returns _text
+CREATE OR REPLACE FUNCTION show_trgm(text)
+RETURNS _text
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-create function similarity(text,text)
-returns float4
+CREATE OR REPLACE FUNCTION similarity(text,text)
+RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-create function similarity_op(text,text)
-returns bool
+CREATE OR REPLACE FUNCTION similarity_op(text,text)
+RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -37,12 +36,12 @@ CREATE OPERATOR % (
);
-- gist key
-CREATE FUNCTION gtrgm_in(cstring)
+CREATE OR REPLACE FUNCTION gtrgm_in(cstring)
RETURNS gtrgm
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
-CREATE FUNCTION gtrgm_out(gtrgm)
+CREATE OR REPLACE FUNCTION gtrgm_out(gtrgm)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
@@ -54,37 +53,37 @@ CREATE TYPE gtrgm (
);
-- support functions for gist
-CREATE FUNCTION gtrgm_consistent(gtrgm,internal,int4)
+CREATE OR REPLACE FUNCTION gtrgm_consistent(gtrgm,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gtrgm_compress(internal)
+CREATE OR REPLACE FUNCTION gtrgm_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gtrgm_decompress(internal)
+CREATE OR REPLACE FUNCTION gtrgm_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gtrgm_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gtrgm_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION gtrgm_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gtrgm_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gtrgm_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gtrgm_union(bytea, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gtrgm_same(gtrgm, gtrgm, internal)
+CREATE OR REPLACE FUNCTION gtrgm_same(gtrgm, gtrgm, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -104,17 +103,17 @@ AS
STORAGE gtrgm;
-- support functions for gin
-CREATE FUNCTION gin_extract_trgm(text, internal)
+CREATE OR REPLACE FUNCTION gin_extract_trgm(text, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gin_extract_trgm(text, internal, internal)
+CREATE OR REPLACE FUNCTION gin_extract_trgm(text, internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gin_trgm_consistent(internal, internal, text)
+CREATE OR REPLACE FUNCTION gin_trgm_consistent(internal, internal, text)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
@@ -129,5 +128,3 @@ AS
FUNCTION 3 gin_extract_trgm (text, internal, internal),
FUNCTION 4 gin_trgm_consistent (internal, internal, text),
STORAGE int4;
-
-COMMIT;
diff --git a/contrib/pg_trgm/uninstall_pg_trgm.sql b/contrib/pg_trgm/uninstall_pg_trgm.sql
index 8ec83618be..f8cbe9ced4 100644
--- a/contrib/pg_trgm/uninstall_pg_trgm.sql
+++ b/contrib/pg_trgm/uninstall_pg_trgm.sql
@@ -1,7 +1,6 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
-BEGIN;
-
DROP OPERATOR CLASS gist_trgm_ops USING gist;
DROP FUNCTION gtrgm_same(gtrgm, gtrgm, internal);
@@ -39,5 +38,3 @@ DROP FUNCTION show_trgm(text);
DROP FUNCTION show_limit();
DROP FUNCTION set_limit(float4);
-
-COMMIT;
diff --git a/contrib/pgcrypto/uninstall_pgcrypto.sql b/contrib/pgcrypto/uninstall_pgcrypto.sql
index e5675943b3..d7146d7b17 100644
--- a/contrib/pgcrypto/uninstall_pgcrypto.sql
+++ b/contrib/pgcrypto/uninstall_pgcrypto.sql
@@ -1,4 +1,4 @@
-
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION digest(text, text);
diff --git a/contrib/pgrowlocks/uninstall_pgrowlocks.sql b/contrib/pgrowlocks/uninstall_pgrowlocks.sql
index b1a1f58b52..d2b2e5cc18 100644
--- a/contrib/pgrowlocks/uninstall_pgrowlocks.sql
+++ b/contrib/pgrowlocks/uninstall_pgrowlocks.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION pgrowlocks(text);
diff --git a/contrib/pgstattuple/uninstall_pgstattuple.sql b/contrib/pgstattuple/uninstall_pgstattuple.sql
index 6d97590d4d..43b8910c77 100644
--- a/contrib/pgstattuple/uninstall_pgstattuple.sql
+++ b/contrib/pgstattuple/uninstall_pgstattuple.sql
@@ -1,4 +1,4 @@
--- Adjust this setting to control where the objects get created.
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION pgstattuple(text);
diff --git a/contrib/seg/seg.sql.in b/contrib/seg/seg.sql.in
index 33521e37de..4f42d1464c 100644
--- a/contrib/seg/seg.sql.in
+++ b/contrib/seg/seg.sql.in
@@ -1,15 +1,15 @@
--- Create the user-defined type for 1-D floating point intervals (seg)
---
-
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-CREATE FUNCTION seg_in(cstring)
+-- Create the user-defined type for 1-D floating point intervals (seg)
+--
+
+CREATE OR REPLACE FUNCTION seg_in(cstring)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION seg_out(seg)
+CREATE OR REPLACE FUNCTION seg_out(seg)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -29,7 +29,7 @@ COMMENT ON TYPE seg IS
-- Left/Right methods
-CREATE FUNCTION seg_over_left(seg, seg)
+CREATE OR REPLACE FUNCTION seg_over_left(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -37,7 +37,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_over_left(seg, seg) IS
'overlaps or is left of';
-CREATE FUNCTION seg_over_right(seg, seg)
+CREATE OR REPLACE FUNCTION seg_over_right(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -45,7 +45,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_over_right(seg, seg) IS
'overlaps or is right of';
-CREATE FUNCTION seg_left(seg, seg)
+CREATE OR REPLACE FUNCTION seg_left(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -53,7 +53,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_left(seg, seg) IS
'is left of';
-CREATE FUNCTION seg_right(seg, seg)
+CREATE OR REPLACE FUNCTION seg_right(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -64,7 +64,7 @@ COMMENT ON FUNCTION seg_right(seg, seg) IS
-- Scalar comparison methods
-CREATE FUNCTION seg_lt(seg, seg)
+CREATE OR REPLACE FUNCTION seg_lt(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -72,7 +72,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_lt(seg, seg) IS
'less than';
-CREATE FUNCTION seg_le(seg, seg)
+CREATE OR REPLACE FUNCTION seg_le(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -80,7 +80,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_le(seg, seg) IS
'less than or equal';
-CREATE FUNCTION seg_gt(seg, seg)
+CREATE OR REPLACE FUNCTION seg_gt(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -88,7 +88,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_gt(seg, seg) IS
'greater than';
-CREATE FUNCTION seg_ge(seg, seg)
+CREATE OR REPLACE FUNCTION seg_ge(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -96,7 +96,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_ge(seg, seg) IS
'greater than or equal';
-CREATE FUNCTION seg_contains(seg, seg)
+CREATE OR REPLACE FUNCTION seg_contains(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -104,7 +104,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_contains(seg, seg) IS
'contains';
-CREATE FUNCTION seg_contained(seg, seg)
+CREATE OR REPLACE FUNCTION seg_contained(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -112,7 +112,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_contained(seg, seg) IS
'contained in';
-CREATE FUNCTION seg_overlap(seg, seg)
+CREATE OR REPLACE FUNCTION seg_overlap(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -120,7 +120,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_overlap(seg, seg) IS
'overlaps';
-CREATE FUNCTION seg_same(seg, seg)
+CREATE OR REPLACE FUNCTION seg_same(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -128,7 +128,7 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_same(seg, seg) IS
'same as';
-CREATE FUNCTION seg_different(seg, seg)
+CREATE OR REPLACE FUNCTION seg_different(seg, seg)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -145,29 +145,29 @@ LANGUAGE C STRICT IMMUTABLE;
COMMENT ON FUNCTION seg_cmp(seg, seg) IS 'btree comparison function';
-CREATE FUNCTION seg_union(seg, seg)
+CREATE OR REPLACE FUNCTION seg_union(seg, seg)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION seg_inter(seg, seg)
+CREATE OR REPLACE FUNCTION seg_inter(seg, seg)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION seg_size(seg)
+CREATE OR REPLACE FUNCTION seg_size(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-- miscellaneous
-CREATE FUNCTION seg_upper(seg)
+CREATE OR REPLACE FUNCTION seg_upper(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION seg_lower(seg)
+CREATE OR REPLACE FUNCTION seg_lower(seg)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
@@ -320,37 +320,37 @@ CREATE OPERATOR ~ (
-- define the GiST support methods
-CREATE FUNCTION gseg_consistent(internal,seg,int4)
+CREATE OR REPLACE FUNCTION gseg_consistent(internal,seg,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gseg_compress(internal)
+CREATE OR REPLACE FUNCTION gseg_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gseg_decompress(internal)
+CREATE OR REPLACE FUNCTION gseg_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gseg_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gseg_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT IMMUTABLE;
-CREATE FUNCTION gseg_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gseg_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gseg_union(internal, internal)
+CREATE OR REPLACE FUNCTION gseg_union(internal, internal)
RETURNS seg
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
-CREATE FUNCTION gseg_same(seg, seg, internal)
+CREATE OR REPLACE FUNCTION gseg_same(seg, seg, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE;
diff --git a/contrib/seg/uninstall_seg.sql b/contrib/seg/uninstall_seg.sql
index ebf93e4930..58b45d87fc 100644
--- a/contrib/seg/uninstall_seg.sql
+++ b/contrib/seg/uninstall_seg.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP OPERATOR CLASS gist_seg_ops USING gist;
diff --git a/contrib/sslinfo/sslinfo.sql.in b/contrib/sslinfo/sslinfo.sql.in
index 5629f16df2..e9fd413b8f 100644
--- a/contrib/sslinfo/sslinfo.sql.in
+++ b/contrib/sslinfo/sslinfo.sql.in
@@ -1,29 +1,31 @@
+-- Adjust this setting to control where the objects get created.
SET search_path = public;
CREATE OR REPLACE FUNCTION ssl_client_serial() RETURNS numeric
- LANGUAGE C STRICT
- AS 'MODULE_PATHNAME', 'ssl_client_serial';
+AS 'MODULE_PATHNAME', 'ssl_client_serial';
+LANGUAGE C STRICT
CREATE OR REPLACE FUNCTION ssl_is_used() RETURNS boolean
- LANGUAGE C STRICT
- AS 'MODULE_PATHNAME', 'ssl_is_used';
+AS 'MODULE_PATHNAME', 'ssl_is_used';
+LANGUAGE C STRICT
CREATE OR REPLACE FUNCTION ssl_client_cert_present() RETURNS boolean
- LANGUAGE C STRICT
- AS 'MODULE_PATHNAME', 'ssl_client_cert_present';
+AS 'MODULE_PATHNAME', 'ssl_client_cert_present';
+LANGUAGE C STRICT
CREATE OR REPLACE FUNCTION ssl_client_dn_field(text) RETURNS text
- LANGUAGE C STRICT
- AS 'MODULE_PATHNAME', 'ssl_client_dn_field';
+AS 'MODULE_PATHNAME', 'ssl_client_dn_field';
+LANGUAGE C STRICT
CREATE OR REPLACE FUNCTION ssl_issuer_field(text) RETURNS text
- LANGUAGE C STRICT
- AS 'MODULE_PATHNAME', 'ssl_issuer_field';
+AS 'MODULE_PATHNAME', 'ssl_issuer_field';
+LANGUAGE C STRICT
CREATE OR REPLACE FUNCTION ssl_client_dn() RETURNS text
- LANGUAGE C STRICT
- AS 'MODULE_PATHNAME', 'ssl_client_dn';
+AS 'MODULE_PATHNAME', 'ssl_client_dn';
+LANGUAGE C STRICT
CREATE OR REPLACE FUNCTION ssl_issuer_dn() RETURNS text
- LANGUAGE C STRICT
- AS 'MODULE_PATHNAME', 'ssl_issuer_dn';
+AS 'MODULE_PATHNAME', 'ssl_issuer_dn';
+LANGUAGE C STRICT
+
diff --git a/contrib/sslinfo/uninstall_sslinfo.sql b/contrib/sslinfo/uninstall_sslinfo.sql
index 90024c908e..6b1b544955 100644
--- a/contrib/sslinfo/uninstall_sslinfo.sql
+++ b/contrib/sslinfo/uninstall_sslinfo.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION ssl_client_serial();
diff --git a/contrib/tablefunc/uninstall_tablefunc.sql b/contrib/tablefunc/uninstall_tablefunc.sql
index e08f683703..301cc5f58e 100644
--- a/contrib/tablefunc/uninstall_tablefunc.sql
+++ b/contrib/tablefunc/uninstall_tablefunc.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION connectby(text,text,text,text,text,int);
diff --git a/contrib/test_parser/test_parser.sql.in b/contrib/test_parser/test_parser.sql.in
index cb5c9a2b03..048f934078 100644
--- a/contrib/test_parser/test_parser.sql.in
+++ b/contrib/test_parser/test_parser.sql.in
@@ -1,29 +1,25 @@
--- $PostgreSQL: pgsql/contrib/test_parser/test_parser.sql.in,v 1.1 2007/10/15 21:36:50 tgl Exp $
-
-- Adjust this setting to control where the objects get created.
SET search_path = public;
-BEGIN;
+CREATE OR REPLACE FUNCTION testprs_start(internal, int4)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
-CREATE FUNCTION testprs_start(internal, int4)
- RETURNS internal
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION testprs_getlexeme(internal, internal, internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
-CREATE FUNCTION testprs_getlexeme(internal, internal, internal)
- RETURNS internal
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION testprs_end(internal)
+RETURNS void
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
-CREATE FUNCTION testprs_end(internal)
- RETURNS void
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
-
-CREATE FUNCTION testprs_lextype(internal)
- RETURNS internal
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT;
+CREATE OR REPLACE FUNCTION testprs_lextype(internal)
+RETURNS internal
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT;
CREATE TEXT SEARCH PARSER testparser (
START = testprs_start,
@@ -32,5 +28,3 @@ CREATE TEXT SEARCH PARSER testparser (
HEADLINE = pg_catalog.prsd_headline,
LEXTYPES = testprs_lextype
);
-
-END;
diff --git a/contrib/test_parser/uninstall_test_parser.sql b/contrib/test_parser/uninstall_test_parser.sql
index d194677d6b..85f64146dd 100644
--- a/contrib/test_parser/uninstall_test_parser.sql
+++ b/contrib/test_parser/uninstall_test_parser.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP TEXT SEARCH PARSER testparser;
diff --git a/contrib/tsearch2/tsearch.sql.in b/contrib/tsearch2/tsearch.sql.in
index 08afa76290..89e049e317 100644
--- a/contrib/tsearch2/tsearch.sql.in
+++ b/contrib/tsearch2/tsearch.sql.in
@@ -1,8 +1,6 @@
-- Adjust this setting to control where the objects get CREATEd.
SET search_path = public;
-BEGIN;
-
--dict conf
CREATE TABLE pg_ts_dict (
dict_name text not null primary key,
@@ -13,47 +11,47 @@ CREATE TABLE pg_ts_dict (
) with oids;
--dict interface
-CREATE FUNCTION lexize(oid, text)
- RETURNS _text
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION lexize(oid, text)
+RETURNS _text
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION lexize(text, text)
+CREATE OR REPLACE FUNCTION lexize(text, text)
RETURNS _text
as 'MODULE_PATHNAME', 'lexize_byname'
LANGUAGE C
RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION lexize(text)
+CREATE OR REPLACE FUNCTION lexize(text)
RETURNS _text
as 'MODULE_PATHNAME', 'lexize_bycurrent'
LANGUAGE C
RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION set_curdict(int)
- RETURNS void
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION set_curdict(int)
+RETURNS void
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION set_curdict(text)
- RETURNS void
- as 'MODULE_PATHNAME', 'set_curdict_byname'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION set_curdict(text)
+RETURNS void
+as 'MODULE_PATHNAME', 'set_curdict_byname'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
--built-in dictionaries
-CREATE FUNCTION dex_init(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION dex_init(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION dex_lexize(internal,internal,int4)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION dex_lexize(internal,internal,int4)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'simple',
@@ -62,17 +60,17 @@ insert into pg_ts_dict select
'dex_lexize(internal,internal,int4)',
'Simple example of dictionary.'
;
-
-CREATE FUNCTION snb_en_init(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+
+CREATE OR REPLACE FUNCTION snb_en_init(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION snb_lexize(internal,internal,int4)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION snb_lexize(internal,internal,int4)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'en_stem',
@@ -82,10 +80,10 @@ insert into pg_ts_dict select
'English Stemmer. Snowball.'
;
-CREATE FUNCTION snb_ru_init_koi8(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION snb_ru_init_koi8(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
insert into pg_ts_dict select
'ru_stem_koi8',
@@ -94,11 +92,11 @@ insert into pg_ts_dict select
'snb_lexize(internal,internal,int4)',
'Russian Stemmer. Snowball. KOI8 Encoding'
;
-
-CREATE FUNCTION snb_ru_init_utf8(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+
+CREATE OR REPLACE FUNCTION snb_ru_init_utf8(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
insert into pg_ts_dict select
'ru_stem_utf8',
@@ -107,17 +105,17 @@ insert into pg_ts_dict select
'snb_lexize(internal,internal,int4)',
'Russian Stemmer. Snowball. UTF8 Encoding'
;
-
-CREATE FUNCTION spell_init(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+
+CREATE OR REPLACE FUNCTION spell_init(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION spell_lexize(internal,internal,int4)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION spell_lexize(internal,internal,int4)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'ispell_template',
@@ -127,16 +125,16 @@ insert into pg_ts_dict select
'ISpell interface. Must have .dict and .aff files'
;
-CREATE FUNCTION syn_init(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION syn_init(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION syn_lexize(internal,internal,int4)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION syn_lexize(internal,internal,int4)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'synonym',
@@ -146,16 +144,16 @@ insert into pg_ts_dict select
'Example of synonym dictionary'
;
-CREATE FUNCTION thesaurus_init(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION thesaurus_init(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION thesaurus_lexize(internal,internal,int4,internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION thesaurus_lexize(internal,internal,int4,internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
insert into pg_ts_dict select
'thesaurus_template',
@@ -178,84 +176,84 @@ CREATE TABLE pg_ts_parser (
--sql-level interface
CREATE TYPE tokentype
- as (tokid int4, alias text, descr text);
+ AS (tokid int4, alias text, descr text);
-CREATE FUNCTION token_type(int4)
- RETURNS setof tokentype
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION token_type(int4)
+RETURNS setof tokentype
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION token_type(text)
- RETURNS setof tokentype
- as 'MODULE_PATHNAME', 'token_type_byname'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION token_type(text)
+RETURNS setof tokentype
+as 'MODULE_PATHNAME', 'token_type_byname'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION token_type()
- RETURNS setof tokentype
- as 'MODULE_PATHNAME', 'token_type_current'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION token_type()
+RETURNS setof tokentype
+as 'MODULE_PATHNAME', 'token_type_current'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION set_curprs(int)
- RETURNS void
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION set_curprs(int)
+RETURNS void
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION set_curprs(text)
- RETURNS void
- as 'MODULE_PATHNAME', 'set_curprs_byname'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION set_curprs(text)
+RETURNS void
+as 'MODULE_PATHNAME', 'set_curprs_byname'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
CREATE TYPE tokenout
- as (tokid int4, token text);
+ AS (tokid int4, token text);
-CREATE FUNCTION parse(oid,text)
- RETURNS setof tokenout
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION parse(oid,text)
+RETURNS setof tokenout
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION parse(text,text)
- RETURNS setof tokenout
- as 'MODULE_PATHNAME', 'parse_byname'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION parse(text,text)
+RETURNS setof tokenout
+as 'MODULE_PATHNAME', 'parse_byname'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION parse(text)
- RETURNS setof tokenout
- as 'MODULE_PATHNAME', 'parse_current'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION parse(text)
+RETURNS setof tokenout
+as 'MODULE_PATHNAME', 'parse_current'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
--default parser
-CREATE FUNCTION prsd_start(internal,int4)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION prsd_start(internal,int4)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION prsd_getlexeme(internal,internal,internal)
- RETURNS int4
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION prsd_getlexeme(internal,internal,internal)
+RETURNS int4
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION prsd_end(internal)
- RETURNS void
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION prsd_end(internal)
+RETURNS void
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION prsd_lextype(internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION prsd_lextype(internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
-CREATE FUNCTION prsd_headline(internal,internal,internal)
- RETURNS internal
- as 'MODULE_PATHNAME'
- LANGUAGE C;
+CREATE OR REPLACE FUNCTION prsd_headline(internal,internal,internal)
+RETURNS internal
+as 'MODULE_PATHNAME'
+LANGUAGE C;
insert into pg_ts_parser select
'default',
@@ -282,23 +280,23 @@ CREATE TABLE pg_ts_cfgmap (
primary key (ts_name,tok_alias)
) with oids;
-CREATE FUNCTION set_curcfg(int)
- RETURNS void
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION set_curcfg(int)
+RETURNS void
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION set_curcfg(text)
- RETURNS void
- as 'MODULE_PATHNAME', 'set_curcfg_byname'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION set_curcfg(text)
+RETURNS void
+as 'MODULE_PATHNAME', 'set_curcfg_byname'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION show_curcfg()
- RETURNS oid
- as 'MODULE_PATHNAME'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION show_curcfg()
+RETURNS oid
+as 'MODULE_PATHNAME'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
insert into pg_ts_cfg values ('default', 'default','C');
insert into pg_ts_cfg values ('default_russian', 'default','ru_RU.KOI8-R');
@@ -383,12 +381,12 @@ insert into pg_ts_cfgmap values ('simple', 'int', '{simple}');
insert into pg_ts_cfgmap values ('simple', 'uint', '{simple}');
--tsvector type
-CREATE FUNCTION tsvector_in(cstring)
+CREATE OR REPLACE FUNCTION tsvector_in(cstring)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION tsvector_out(tsvector)
+CREATE OR REPLACE FUNCTION tsvector_out(tsvector)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
@@ -400,37 +398,37 @@ CREATE TYPE tsvector (
STORAGE = extended
);
-CREATE FUNCTION length(tsvector)
+CREATE OR REPLACE FUNCTION length(tsvector)
RETURNS int4
AS 'MODULE_PATHNAME', 'tsvector_length'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION to_tsvector(oid, text)
+CREATE OR REPLACE FUNCTION to_tsvector(oid, text)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION to_tsvector(text, text)
+CREATE OR REPLACE FUNCTION to_tsvector(text, text)
RETURNS tsvector
AS 'MODULE_PATHNAME', 'to_tsvector_name'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION to_tsvector(text)
+CREATE OR REPLACE FUNCTION to_tsvector(text)
RETURNS tsvector
AS 'MODULE_PATHNAME', 'to_tsvector_current'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION strip(tsvector)
+CREATE OR REPLACE FUNCTION strip(tsvector)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION setweight(tsvector,"char")
+CREATE OR REPLACE FUNCTION setweight(tsvector,"char")
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION concat(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION concat(tsvector,tsvector)
RETURNS tsvector
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
@@ -442,12 +440,12 @@ CREATE OPERATOR || (
);
--query type
-CREATE FUNCTION tsquery_in(cstring)
+CREATE OR REPLACE FUNCTION tsquery_in(cstring)
RETURNS tsquery
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION tsquery_out(tsquery)
+CREATE OR REPLACE FUNCTION tsquery_out(tsquery)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
@@ -459,50 +457,50 @@ CREATE TYPE tsquery (
OUTPUT = tsquery_out
);
-CREATE FUNCTION querytree(tsquery)
+CREATE OR REPLACE FUNCTION querytree(tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'tsquerytree'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION to_tsquery(oid, text)
+CREATE OR REPLACE FUNCTION to_tsquery(oid, text)
RETURNS tsquery
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION to_tsquery(text, text)
+CREATE OR REPLACE FUNCTION to_tsquery(text, text)
RETURNS tsquery
AS 'MODULE_PATHNAME','to_tsquery_name'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION to_tsquery(text)
+CREATE OR REPLACE FUNCTION to_tsquery(text)
RETURNS tsquery
AS 'MODULE_PATHNAME','to_tsquery_current'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION plainto_tsquery(oid, text)
+CREATE OR REPLACE FUNCTION plainto_tsquery(oid, text)
RETURNS tsquery
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION plainto_tsquery(text, text)
+CREATE OR REPLACE FUNCTION plainto_tsquery(text, text)
RETURNS tsquery
AS 'MODULE_PATHNAME','plainto_tsquery_name'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION plainto_tsquery(text)
+CREATE OR REPLACE FUNCTION plainto_tsquery(text)
RETURNS tsquery
AS 'MODULE_PATHNAME','plainto_tsquery_current'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
--operations
-CREATE FUNCTION exectsq(tsvector, tsquery)
+CREATE OR REPLACE FUNCTION exectsq(tsvector, tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
COMMENT ON FUNCTION exectsq(tsvector, tsquery) IS 'boolean operation with text index';
-CREATE FUNCTION rexectsq(tsquery, tsvector)
+CREATE OR REPLACE FUNCTION rexectsq(tsquery, tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
@@ -527,90 +525,90 @@ CREATE OPERATOR @@ (
);
--Trigger
-CREATE FUNCTION tsearch2()
+CREATE OR REPLACE FUNCTION tsearch2()
RETURNS trigger
AS 'MODULE_PATHNAME'
LANGUAGE C;
--Relevation
-CREATE FUNCTION rank(float4[], tsvector, tsquery)
+CREATE OR REPLACE FUNCTION rank(float4[], tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION rank(float4[], tsvector, tsquery, int4)
+CREATE OR REPLACE FUNCTION rank(float4[], tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION rank(tsvector, tsquery)
+CREATE OR REPLACE FUNCTION rank(tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_def'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION rank(tsvector, tsquery, int4)
+CREATE OR REPLACE FUNCTION rank(tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_def'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION rank_cd(float4[], tsvector, tsquery)
+CREATE OR REPLACE FUNCTION rank_cd(float4[], tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION rank_cd(float4[], tsvector, tsquery, int4)
+CREATE OR REPLACE FUNCTION rank_cd(float4[], tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION rank_cd(tsvector, tsquery)
+CREATE OR REPLACE FUNCTION rank_cd(tsvector, tsquery)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_cd_def'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION rank_cd(tsvector, tsquery, int4)
+CREATE OR REPLACE FUNCTION rank_cd(tsvector, tsquery, int4)
RETURNS float4
AS 'MODULE_PATHNAME', 'rank_cd_def'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION headline(oid, text, tsquery, text)
+CREATE OR REPLACE FUNCTION headline(oid, text, tsquery, text)
RETURNS text
AS 'MODULE_PATHNAME', 'headline'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION headline(oid, text, tsquery)
+CREATE OR REPLACE FUNCTION headline(oid, text, tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'headline'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION headline(text, text, tsquery, text)
+CREATE OR REPLACE FUNCTION headline(text, text, tsquery, text)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_byname'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION headline(text, text, tsquery)
+CREATE OR REPLACE FUNCTION headline(text, text, tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_byname'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION headline(text, tsquery, text)
+CREATE OR REPLACE FUNCTION headline(text, tsquery, text)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_current'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION headline(text, tsquery)
+CREATE OR REPLACE FUNCTION headline(text, tsquery)
RETURNS text
AS 'MODULE_PATHNAME', 'headline_current'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
--GiST
--GiST key type
-CREATE FUNCTION gtsvector_in(cstring)
+CREATE OR REPLACE FUNCTION gtsvector_in(cstring)
RETURNS gtsvector
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION gtsvector_out(gtsvector)
+CREATE OR REPLACE FUNCTION gtsvector_out(gtsvector)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
@@ -622,37 +620,37 @@ CREATE TYPE gtsvector (
);
-- support FUNCTIONs
-CREATE FUNCTION gtsvector_consistent(gtsvector,internal,int4)
+CREATE OR REPLACE FUNCTION gtsvector_consistent(gtsvector,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsvector_compress(internal)
+CREATE OR REPLACE FUNCTION gtsvector_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsvector_decompress(internal)
+CREATE OR REPLACE FUNCTION gtsvector_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsvector_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gtsvector_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION gtsvector_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gtsvector_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsvector_union(internal, internal)
+CREATE OR REPLACE FUNCTION gtsvector_union(internal, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsvector_same(gtsvector, gtsvector, internal)
+CREATE OR REPLACE FUNCTION gtsvector_same(gtsvector, gtsvector, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
@@ -674,14 +672,14 @@ AS
--stat info
CREATE TYPE statinfo
- as (word text, ndoc int4, nentry int4);
+ AS (word text, ndoc int4, nentry int4);
---CREATE FUNCTION tsstat_in(cstring)
+--CREATE OR REPLACE FUNCTION tsstat_in(cstring)
--RETURNS tsstat
--AS 'MODULE_PATHNAME'
--LANGUAGE C RETURNS NULL ON NULL INPUT;
--
---CREATE FUNCTION tsstat_out(tsstat)
+--CREATE OR REPLACE FUNCTION tsstat_out(tsstat)
--RETURNS cstring
--AS 'MODULE_PATHNAME'
--LANGUAGE C RETURNS NULL ON NULL INPUT;
@@ -693,12 +691,12 @@ CREATE TYPE statinfo
-- STORAGE = plain
--);
--
---CREATE FUNCTION ts_accum(tsstat,tsvector)
+--CREATE OR REPLACE FUNCTION ts_accum(tsstat,tsvector)
--RETURNS tsstat
--AS 'MODULE_PATHNAME'
--LANGUAGE C RETURNS NULL ON NULL INPUT;
--
---CREATE FUNCTION ts_accum_finish(tsstat)
+--CREATE OR REPLACE FUNCTION ts_accum_finish(tsstat)
-- RETURNS setof statinfo
-- as 'MODULE_PATHNAME'
-- LANGUAGE C
@@ -712,27 +710,27 @@ CREATE TYPE statinfo
-- initcond = ''
--);
-CREATE FUNCTION stat(text)
- RETURNS setof statinfo
- as 'MODULE_PATHNAME', 'ts_stat'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION stat(text)
+RETURNS setof statinfo
+as 'MODULE_PATHNAME', 'ts_stat'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION stat(text,text)
- RETURNS setof statinfo
- as 'MODULE_PATHNAME', 'ts_stat'
- LANGUAGE C
- RETURNS NULL ON NULL INPUT;
+CREATE OR REPLACE FUNCTION stat(text,text)
+RETURNS setof statinfo
+as 'MODULE_PATHNAME', 'ts_stat'
+LANGUAGE C
+RETURNS NULL ON NULL INPUT;
--reset - just for debuging
-CREATE FUNCTION reset_tsearch()
+CREATE OR REPLACE FUNCTION reset_tsearch()
RETURNS void
as 'MODULE_PATHNAME'
LANGUAGE C
RETURNS NULL ON NULL INPUT;
--get cover (debug for rank_cd)
-CREATE FUNCTION get_covers(tsvector,tsquery)
+CREATE OR REPLACE FUNCTION get_covers(tsvector,tsquery)
RETURNS text
as 'MODULE_PATHNAME'
LANGUAGE C
@@ -748,12 +746,12 @@ create type tsdebug as (
"tsvector" tsvector
);
-CREATE FUNCTION _get_parser_from_curcfg()
+CREATE OR REPLACE FUNCTION _get_parser_from_curcfg()
RETURNS text as
' select prs_name from pg_ts_cfg where oid = show_curcfg() '
LANGUAGE SQL RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION ts_debug(text)
+CREATE OR REPLACE FUNCTION ts_debug(text)
RETURNS setof tsdebug as '
select
m.ts_name,
@@ -775,37 +773,37 @@ where
' LANGUAGE SQL RETURNS NULL ON NULL INPUT;
--compare functions
-CREATE FUNCTION tsvector_cmp(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION tsvector_cmp(tsvector,tsvector)
RETURNS int4
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION tsvector_lt(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION tsvector_lt(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION tsvector_le(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION tsvector_le(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION tsvector_eq(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION tsvector_eq(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION tsvector_ge(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION tsvector_ge(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION tsvector_gt(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION tsvector_gt(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
-CREATE FUNCTION tsvector_ne(tsvector,tsvector)
+CREATE OR REPLACE FUNCTION tsvector_ne(tsvector,tsvector)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT IMMUTABLE;
@@ -1119,12 +1117,12 @@ CREATE OPERATOR ~ (
-----------gist support of rewrite------------------
-CREATE FUNCTION gtsq_in(cstring)
+CREATE OR REPLACE FUNCTION gtsq_in(cstring)
RETURNS gtsq
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION gtsq_out(gtsq)
+CREATE OR REPLACE FUNCTION gtsq_out(gtsq)
RETURNS cstring
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
@@ -1135,37 +1133,37 @@ CREATE TYPE gtsq (
OUTPUT = gtsq_out
);
-CREATE FUNCTION gtsq_consistent(gtsq,internal,int4)
+CREATE OR REPLACE FUNCTION gtsq_consistent(gtsq,internal,int4)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsq_compress(internal)
+CREATE OR REPLACE FUNCTION gtsq_compress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsq_decompress(internal)
+CREATE OR REPLACE FUNCTION gtsq_decompress(internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsq_penalty(internal,internal,internal)
+CREATE OR REPLACE FUNCTION gtsq_penalty(internal,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION gtsq_picksplit(internal, internal)
+CREATE OR REPLACE FUNCTION gtsq_picksplit(internal, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsq_union(bytea, internal)
+CREATE OR REPLACE FUNCTION gtsq_union(bytea, internal)
RETURNS _int4
AS 'MODULE_PATHNAME'
LANGUAGE C;
-CREATE FUNCTION gtsq_same(gtsq, gtsq, internal)
+CREATE OR REPLACE FUNCTION gtsq_same(gtsq, gtsq, internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C;
@@ -1187,17 +1185,17 @@ AS
STORAGE gtsq;
--GIN support function
-CREATE FUNCTION gin_extract_tsvector(tsvector,internal)
+CREATE OR REPLACE FUNCTION gin_extract_tsvector(tsvector,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION gin_extract_tsquery(tsquery,internal,internal)
+CREATE OR REPLACE FUNCTION gin_extract_tsquery(tsquery,internal,internal)
RETURNS internal
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
-CREATE FUNCTION gin_ts_consistent(internal,internal,tsquery)
+CREATE OR REPLACE FUNCTION gin_ts_consistent(internal,internal,tsquery)
RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C RETURNS NULL ON NULL INPUT;
@@ -1240,4 +1238,3 @@ AS
--example of thesaurus dict
--update pg_ts_dict set dict_initoption='DictFile="contrib/thesaurus", Dictionary="en_stem"' where dict_name='thesaurus_template';
--update pg_ts_cfgmap set dict_name = '{thesaurus_template,en_stem}' where dict_name = '{en_stem}';
-END;
diff --git a/contrib/tsearch2/untsearch.sql.in b/contrib/tsearch2/untsearch.sql.in
index 26683c478e..0b6f761351 100644
--- a/contrib/tsearch2/untsearch.sql.in
+++ b/contrib/tsearch2/untsearch.sql.in
@@ -1,9 +1,5 @@
-BEGIN;
-
---Be careful !!!
---script drops all indices, triggers and columns with types defined
---in tsearch2.sql
-
+-- Adjust this setting to control where the objects get dropped.
+SET search_path = public;
DROP OPERATOR CLASS gin_tsvector_ops USING gin CASCADE;
@@ -71,5 +67,3 @@ DROP FUNCTION gtsq_union(bytea, internal);
DROP FUNCTION reset_tsearch();
DROP FUNCTION tsearch2() CASCADE;
DROP FUNCTION _get_parser_from_curcfg();
-
-END;
diff --git a/contrib/uuid-ossp/uninstall_uuid-ossp.sql b/contrib/uuid-ossp/uninstall_uuid-ossp.sql
index 30226e98c5..71611e11ed 100644
--- a/contrib/uuid-ossp/uninstall_uuid-ossp.sql
+++ b/contrib/uuid-ossp/uninstall_uuid-ossp.sql
@@ -1,5 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/uuid-ossp/uninstall_uuid-ossp.sql,v 1.1 2007/04/21 17:26:17 petere Exp $ */
-
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION uuid_nil();
diff --git a/contrib/uuid-ossp/uuid-ossp.sql.in b/contrib/uuid-ossp/uuid-ossp.sql.in
index 69b065955a..abc8dfdebb 100644
--- a/contrib/uuid-ossp/uuid-ossp.sql.in
+++ b/contrib/uuid-ossp/uuid-ossp.sql.in
@@ -1,15 +1,53 @@
-/* $PostgreSQL: pgsql/contrib/uuid-ossp/uuid-ossp.sql.in,v 1.2 2007/04/22 21:16:18 petere Exp $ */
-
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
-CREATE FUNCTION uuid_nil() RETURNS uuid IMMUTABLE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_nil';
-CREATE FUNCTION uuid_ns_dns() RETURNS uuid IMMUTABLE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_ns_dns';
-CREATE FUNCTION uuid_ns_url() RETURNS uuid IMMUTABLE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_ns_url';
-CREATE FUNCTION uuid_ns_oid() RETURNS uuid IMMUTABLE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_ns_oid';
-CREATE FUNCTION uuid_ns_x500() RETURNS uuid IMMUTABLE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_ns_x500';
+CREATE OR REPLACE FUNCTION uuid_nil()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_nil';
+IMMUTABLE STRICT LANGUAGE C
-CREATE FUNCTION uuid_generate_v1() RETURNS uuid VOLATILE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_generate_v1';
-CREATE FUNCTION uuid_generate_v1mc() RETURNS uuid VOLATILE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_generate_v1mc';
-CREATE FUNCTION uuid_generate_v3(namespace uuid, name text) RETURNS uuid IMMUTABLE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_generate_v3';
-CREATE FUNCTION uuid_generate_v4() RETURNS uuid VOLATILE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_generate_v4';
-CREATE FUNCTION uuid_generate_v5(namespace uuid, name text) RETURNS uuid IMMUTABLE STRICT LANGUAGE C AS 'MODULE_PATHNAME', 'uuid_generate_v5';
+CREATE OR REPLACE FUNCTION uuid_ns_dns()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_ns_dns';
+IMMUTABLE STRICT LANGUAGE C
+
+CREATE OR REPLACE FUNCTION uuid_ns_url()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_ns_url';
+IMMUTABLE STRICT LANGUAGE C
+
+CREATE OR REPLACE FUNCTION uuid_ns_oid()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_ns_oid';
+IMMUTABLE STRICT LANGUAGE C
+
+CREATE OR REPLACE FUNCTION uuid_ns_x500()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_ns_x500';
+IMMUTABLE STRICT LANGUAGE C
+
+
+CREATE OR REPLACE FUNCTION uuid_generate_v1()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_generate_v1';
+VOLATILE STRICT LANGUAGE C
+
+CREATE OR REPLACE FUNCTION uuid_generate_v1mc()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_generate_v1mc';
+VOLATILE STRICT LANGUAGE C
+
+CREATE OR REPLACE FUNCTION uuid_generate_v3(namespace uuid, name text)
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_generate_v3';
+IMMUTABLE STRICT LANGUAGE C
+
+CREATE OR REPLACE FUNCTION uuid_generate_v4()
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_generate_v4';
+VOLATILE STRICT LANGUAGE C
+
+CREATE OR REPLACE FUNCTION uuid_generate_v5(namespace uuid, name text)
+RETURNS uuid
+AS 'MODULE_PATHNAME', 'uuid_generate_v5';
+IMMUTABLE STRICT LANGUAGE C
diff --git a/contrib/xml2/pgxml.sql.in b/contrib/xml2/pgxml.sql.in
index 4555cc8331..aa76430b41 100644
--- a/contrib/xml2/pgxml.sql.in
+++ b/contrib/xml2/pgxml.sql.in
@@ -1,64 +1,84 @@
+-- Adjust this setting to control where the objects get created.
+SET search_path = public;
+
--SQL for XML parser
CREATE OR REPLACE FUNCTION xml_is_well_formed(text) RETURNS bool
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
-- deprecated old name for xml_is_well_formed
CREATE OR REPLACE FUNCTION xml_valid(text) RETURNS bool
- AS 'MODULE_PATHNAME', 'xml_is_well_formed' LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME', 'xml_is_well_formed'
+LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xml_encode_special_chars(text) RETURNS text
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_string(text,text) RETURNS text
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_nodeset(text,text,text,text) RETURNS text
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_number(text,text) RETURNS float4
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
CREATE OR REPLACE FUNCTION xpath_bool(text,text) RETURNS boolean
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
-- List function
CREATE OR REPLACE FUNCTION xpath_list(text,text,text) RETURNS text
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT IMMUTABLE;
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
-CREATE OR REPLACE FUNCTION xpath_list(text,text) RETURNS text
-AS 'SELECT xpath_list($1,$2,'','')' LANGUAGE SQL STRICT IMMUTABLE;
+CREATE OR REPLACE FUNCTION xpath_list(text,text) RETURNS text
+AS 'SELECT xpath_list($1,$2,'','')'
+LANGUAGE SQL STRICT IMMUTABLE;
-- Wrapper functions for nodeset where no tags needed
-CREATE OR REPLACE FUNCTION xpath_nodeset(text,text) RETURNS text AS
-'SELECT xpath_nodeset($1,$2,'''','''')' LANGUAGE SQL STRICT IMMUTABLE;
+CREATE OR REPLACE FUNCTION xpath_nodeset(text,text)
+RETURNS text
+AS 'SELECT xpath_nodeset($1,$2,'''','''')'
+LANGUAGE SQL STRICT IMMUTABLE;
-CREATE OR REPLACE FUNCTION xpath_nodeset(text,text,text) RETURNS text AS
-'SELECT xpath_nodeset($1,$2,'''',$3)' LANGUAGE SQL STRICT IMMUTABLE;
+CREATE OR REPLACE FUNCTION xpath_nodeset(text,text,text)
+RETURNS text
+AS 'SELECT xpath_nodeset($1,$2,'''',$3)'
+LANGUAGE SQL STRICT IMMUTABLE;
-- Table function
-CREATE OR REPLACE FUNCTION xpath_table(text,text,text,text,text) RETURNS setof record
- AS 'MODULE_PATHNAME'
- LANGUAGE C STRICT STABLE;
+CREATE OR REPLACE FUNCTION xpath_table(text,text,text,text,text)
+RETURNS setof record
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT STABLE;
-- XSLT functions
-- Delete from here to the end of the file if you are not compiling with
-- XSLT support.
-CREATE OR REPLACE FUNCTION xslt_process(text,text,text) RETURNS text
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT VOLATILE;
+CREATE OR REPLACE FUNCTION xslt_process(text,text,text)
+RETURNS text
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT VOLATILE;
-- the function checks for the correct argument count
-CREATE OR REPLACE FUNCTION xslt_process(text,text) RETURNS text
- AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE;
+CREATE OR REPLACE FUNCTION xslt_process(text,text)
+RETURNS text
+AS 'MODULE_PATHNAME'
+LANGUAGE C STRICT IMMUTABLE;
diff --git a/contrib/xml2/uninstall_pgxml.sql b/contrib/xml2/uninstall_pgxml.sql
index f375f59724..7081ae383f 100644
--- a/contrib/xml2/uninstall_pgxml.sql
+++ b/contrib/xml2/uninstall_pgxml.sql
@@ -1,3 +1,4 @@
+-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP FUNCTION xslt_process(text,text);
diff --git a/doc/src/sgml/contrib.sgml b/doc/src/sgml/contrib.sgml
index 54c66d33a5..67a158d4f5 100644
--- a/doc/src/sgml/contrib.sgml
+++ b/doc/src/sgml/contrib.sgml
@@ -16,11 +16,17 @@
these cases, you will need to run make and make
install in contrib/module. After you have
installed the files you need to register the new entities in the database
- system by running the commands in the supplied .sql file. For example,
+ system by running the commands in the supplied .sql> file.
+ For example,
$ psql -d dbname -f module.sql
+
+ You can modify the first command in the .sql> file to control
+ the schema where the module is created. During major upgrades, even
+ though the restored database might already have the desired module
+ functions, run the installation script again to add any new functions.
&adminpack;