Skip to content

Commit e0b15e2

Browse files
committed
Fix insufficient search-path paranoia in SQL function definitions.
Remove setting of search_path in install/uninstall scripts, since unlike other contrib modules this one does not want to let you change the installation schema.
1 parent 14f461d commit e0b15e2

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

contrib/adminpack/adminpack.sql.in

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
-- Adjust this setting to control where the objects get created.
2-
SET search_path = public;
3-
41
/* ***********************************************
52
* Administrative functions for PostgreSQL
63
* *********************************************** */
@@ -19,7 +16,7 @@ LANGUAGE C VOLATILE;
1916

2017
CREATE OR REPLACE FUNCTION pg_catalog.pg_file_rename(text, text)
2118
RETURNS bool
22-
AS 'SELECT pg_file_rename($1, $2, NULL); '
19+
AS 'SELECT pg_catalog.pg_file_rename($1, $2, NULL::pg_catalog.text);'
2320
LANGUAGE SQL VOLATILE STRICT;
2421

2522
CREATE OR REPLACE FUNCTION pg_catalog.pg_file_unlink(text)
@@ -42,11 +39,10 @@ LANGUAGE INTERNAL VOLATILE STRICT;
4239

4340
CREATE OR REPLACE FUNCTION pg_catalog.pg_file_length(text)
4441
RETURNS bigint
45-
AS 'SELECT size FROM pg_stat_file($1)'
42+
AS 'SELECT size FROM pg_catalog.pg_stat_file($1)'
4643
LANGUAGE SQL VOLATILE STRICT;
4744

4845
CREATE OR REPLACE FUNCTION pg_catalog.pg_logfile_rotate()
4946
RETURNS int4
5047
AS 'pg_rotate_logfile'
5148
LANGUAGE INTERNAL VOLATILE STRICT;
52-

contrib/adminpack/uninstall_adminpack.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
-- Adjust this setting to control where the objects get dropped.
2-
SET search_path = public;
3-
41
DROP FUNCTION pg_catalog.pg_file_write(text, text, bool) ;
52
DROP FUNCTION pg_catalog.pg_file_rename(text, text, text) ;
63
DROP FUNCTION pg_catalog.pg_file_rename(text, text) ;

0 commit comments

Comments
 (0)