Skip to content

Commit 475cf53

Browse files
committed
Preserve pg_catalog at end of search path if it is the case to allow
pg_catalog overloaded function to be executed. Add regression test on search_path forcing.
1 parent 4990e59 commit 475cf53

3 files changed

Lines changed: 63 additions & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ TESTS = 00_init 01_oncommitdelete 02_oncommitpreserve \
2121
03_createontruncate 04_rename 05_useindex \
2222
06_createas 07_createlike 08_plplgsql \
2323
09_transaction 10_foreignkey 11_after_error \
24-
12_droptable
24+
12_droptable 13_searchpath
2525

2626
REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS))
2727
REGRESS_OPTS = --inputdir=test

test/expected/13_searchpath.out

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
----
2+
-- Regression test to Global Temporary Table implementation
3+
--
4+
-- Test on search_path forced by the extension
5+
--
6+
----
7+
SHOW search_path ;
8+
search_path
9+
------------------------------
10+
"$user", public, pgtt_schema
11+
(1 row)
12+
13+
create schema first_schema;
14+
create schema second_schema;
15+
SET search_path TO "$user", public, fisrt_schema, second_schema,pg_catalog;
16+
SHOW search_path ;
17+
search_path
18+
-----------------------------------------------------------------------
19+
"$user", public, fisrt_schema, second_schema, pg_catalog, pgtt_schema
20+
(1 row)
21+
22+
CREATE EXTENSION pgtt;
23+
ERROR: extension "pgtt" already exists
24+
SHOW search_path ;
25+
search_path
26+
-----------------------------------------------------------------------
27+
"$user", public, fisrt_schema, second_schema, pg_catalog, pgtt_schema
28+
(1 row)
29+
30+
SET search_path TO pg_catalog;
31+
SHOW search_path ;
32+
search_path
33+
-------------------------
34+
pg_catalog, pgtt_schema
35+
(1 row)
36+
37+
SET search_path TO public;
38+
SHOW search_path ;
39+
search_path
40+
---------------------
41+
public, pgtt_schema
42+
(1 row)
43+

test/sql/13_searchpath.sql

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
----
2+
-- Regression test to Global Temporary Table implementation
3+
--
4+
-- Test on search_path forced by the extension
5+
--
6+
----
7+
8+
9+
SHOW search_path ;
10+
create schema first_schema;
11+
create schema second_schema;
12+
SET search_path TO "$user", public, fisrt_schema, second_schema,pg_catalog;
13+
SHOW search_path ;
14+
CREATE EXTENSION pgtt;
15+
SHOW search_path ;
16+
SET search_path TO pg_catalog;
17+
SHOW search_path ;
18+
SET search_path TO public;
19+
SHOW search_path ;

0 commit comments

Comments
 (0)