summaryrefslogtreecommitdiffstats
path: root/src/test/regress/expected/create_schema.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/create_schema.out')
-rw-r--r--src/test/regress/expected/create_schema.out98
1 files changed, 98 insertions, 0 deletions
diff --git a/src/test/regress/expected/create_schema.out b/src/test/regress/expected/create_schema.out
new file mode 100644
index 0000000..93302a0
--- /dev/null
+++ b/src/test/regress/expected/create_schema.out
@@ -0,0 +1,98 @@
+--
+-- CREATE_SCHEMA
+--
+-- Schema creation with elements.
+CREATE ROLE regress_create_schema_role SUPERUSER;
+-- Cases where schema creation fails as objects are qualified with a schema
+-- that does not match with what's expected.
+-- This checks all the object types that include schema qualifications.
+CREATE SCHEMA AUTHORIZATION regress_create_schema_role
+ CREATE SEQUENCE schema_not_existing.seq;
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION regress_create_schema_role
+ CREATE TABLE schema_not_existing.tab (id int);
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION regress_create_schema_role
+ CREATE VIEW schema_not_existing.view AS SELECT 1;
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION regress_create_schema_role
+ CREATE INDEX ON schema_not_existing.tab (id);
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION regress_create_schema_role
+ CREATE TRIGGER schema_trig BEFORE INSERT ON schema_not_existing.tab
+ EXECUTE FUNCTION schema_trig.no_func();
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+-- Again, with a role specification and no schema names.
+SET ROLE regress_create_schema_role;
+CREATE SCHEMA AUTHORIZATION CURRENT_ROLE
+ CREATE SEQUENCE schema_not_existing.seq;
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION CURRENT_ROLE
+ CREATE TABLE schema_not_existing.tab (id int);
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION CURRENT_ROLE
+ CREATE VIEW schema_not_existing.view AS SELECT 1;
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION CURRENT_ROLE
+ CREATE INDEX ON schema_not_existing.tab (id);
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+CREATE SCHEMA AUTHORIZATION CURRENT_ROLE
+ CREATE TRIGGER schema_trig BEFORE INSERT ON schema_not_existing.tab
+ EXECUTE FUNCTION schema_trig.no_func();
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_create_schema_role)
+-- Again, with a schema name and a role specification.
+CREATE SCHEMA regress_schema_1 AUTHORIZATION CURRENT_ROLE
+ CREATE SEQUENCE schema_not_existing.seq;
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_schema_1)
+CREATE SCHEMA regress_schema_1 AUTHORIZATION CURRENT_ROLE
+ CREATE TABLE schema_not_existing.tab (id int);
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_schema_1)
+CREATE SCHEMA regress_schema_1 AUTHORIZATION CURRENT_ROLE
+ CREATE VIEW schema_not_existing.view AS SELECT 1;
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_schema_1)
+CREATE SCHEMA regress_schema_1 AUTHORIZATION CURRENT_ROLE
+ CREATE INDEX ON schema_not_existing.tab (id);
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_schema_1)
+CREATE SCHEMA regress_schema_1 AUTHORIZATION CURRENT_ROLE
+ CREATE TRIGGER schema_trig BEFORE INSERT ON schema_not_existing.tab
+ EXECUTE FUNCTION schema_trig.no_func();
+ERROR: CREATE specifies a schema (schema_not_existing) different from the one being created (regress_schema_1)
+RESET ROLE;
+-- Cases where the schema creation succeeds.
+-- The schema created matches the role name.
+CREATE SCHEMA AUTHORIZATION regress_create_schema_role
+ CREATE TABLE regress_create_schema_role.tab (id int);
+\d regress_create_schema_role.tab
+ Table "regress_create_schema_role.tab"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | |
+
+DROP SCHEMA regress_create_schema_role CASCADE;
+NOTICE: drop cascades to table regress_create_schema_role.tab
+-- Again, with a different role specification and no schema names.
+SET ROLE regress_create_schema_role;
+CREATE SCHEMA AUTHORIZATION CURRENT_ROLE
+ CREATE TABLE regress_create_schema_role.tab (id int);
+\d regress_create_schema_role.tab
+ Table "regress_create_schema_role.tab"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | |
+
+DROP SCHEMA regress_create_schema_role CASCADE;
+NOTICE: drop cascades to table tab
+-- Again, with a schema name and a role specification.
+CREATE SCHEMA regress_schema_1 AUTHORIZATION CURRENT_ROLE
+ CREATE TABLE regress_schema_1.tab (id int);
+\d regress_schema_1.tab
+ Table "regress_schema_1.tab"
+ Column | Type | Collation | Nullable | Default
+--------+---------+-----------+----------+---------
+ id | integer | | |
+
+DROP SCHEMA regress_schema_1 CASCADE;
+NOTICE: drop cascades to table regress_schema_1.tab
+RESET ROLE;
+-- Clean up
+DROP ROLE regress_create_schema_role;