2 -- Regression tests for schemas (namespaces)
4 CREATE SCHEMA test_schema_1
5 CREATE UNIQUE INDEX abc_a_idx ON abc (a)
6 CREATE VIEW abc_view AS
7 SELECT a+1 AS a, b+1 AS b FROM abc
12 NOTICE: CREATE TABLE will create implicit sequence "abc_a_seq" for serial column "abc.a"
13 NOTICE: CREATE TABLE / UNIQUE will create implicit index "abc_b_key" for table "abc"
14 -- verify that the objects were created
15 SELECT COUNT(*) FROM pg_class WHERE relnamespace =
16 (SELECT oid FROM pg_namespace WHERE nspname = 'test_schema_1');
22 INSERT INTO test_schema_1.abc DEFAULT VALUES;
23 INSERT INTO test_schema_1.abc DEFAULT VALUES;
24 INSERT INTO test_schema_1.abc DEFAULT VALUES;
25 SELECT * FROM test_schema_1.abc;
33 SELECT * FROM test_schema_1.abc_view;
41 DROP SCHEMA test_schema_1 CASCADE;
42 NOTICE: drop cascades to 2 other objects
43 DETAIL: drop cascades to table test_schema_1.abc
44 drop cascades to view test_schema_1.abc_view
45 -- verify that the objects were dropped
46 SELECT COUNT(*) FROM pg_class WHERE relnamespace =
47 (SELECT oid FROM pg_namespace WHERE nspname = 'test_schema_1');