diff options
Diffstat (limited to 'src/test/regress/sql/namespace.sql')
-rw-r--r-- | src/test/regress/sql/namespace.sql | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/regress/sql/namespace.sql b/src/test/regress/sql/namespace.sql index 6b12c96193..3474f5ecf4 100644 --- a/src/test/regress/sql/namespace.sql +++ b/src/test/regress/sql/namespace.sql @@ -2,6 +2,10 @@ -- Regression tests for schemas (namespaces) -- +-- set the whitespace-only search_path to test that the +-- GUC list syntax is preserved during a schema creation +SELECT pg_catalog.set_config('search_path', ' ', false); + CREATE SCHEMA test_ns_schema_1 CREATE UNIQUE INDEX abc_a_idx ON abc (a) @@ -13,6 +17,26 @@ CREATE SCHEMA test_ns_schema_1 b int UNIQUE ); +-- verify that the correct search_path restored on abort +SET search_path to public; +BEGIN; +SET search_path to public, test_ns_schema_1; +CREATE SCHEMA test_ns_schema_2 + CREATE VIEW abc_view AS SELECT c FROM abc; +COMMIT; +SHOW search_path; + +-- verify that the correct search_path preserved +-- after creating the schema and on commit +BEGIN; +SET search_path to public, test_ns_schema_1; +CREATE SCHEMA test_ns_schema_2 + CREATE VIEW abc_view AS SELECT a FROM abc; +SHOW search_path; +COMMIT; +SHOW search_path; +DROP SCHEMA test_ns_schema_2 CASCADE; + -- verify that the objects were created SELECT COUNT(*) FROM pg_class WHERE relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = 'test_ns_schema_1'); |