summaryrefslogtreecommitdiff
path: root/contrib/adminpack
diff options
context:
space:
mode:
authorBruce Momjian2007-11-11 03:25:35 +0000
committerBruce Momjian2007-11-11 03:25:35 +0000
commit926bbab44832ae2763392077ecefa029d14c8544 (patch)
treee70fd1806e8a04b019808e1c71428568eb900f8c /contrib/adminpack
parent541ff409cc341ce1e0212fc6a7d67eef6709b6b4 (diff)
Make /contrib install/uninstall script consistent:
remove transactions use create or replace function make formatting consistent set search patch on first line Add documentation on modifying *.sql to set the search patch, and mention that major upgrades should still run the installation scripts. Some of these issues were spotted by Tom today.
Diffstat (limited to 'contrib/adminpack')
-rw-r--r--contrib/adminpack/adminpack.sql.in61
-rw-r--r--contrib/adminpack/uninstall_adminpack.sql3
2 files changed, 39 insertions, 25 deletions
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) ;