summaryrefslogtreecommitdiff
path: root/src/test/regress/sql
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2004-01-11 04:58:17 +0000
committerNeil Conway <neilc@samurai.com>2004-01-11 04:58:17 +0000
commite97b8f2da9ee93f3f957bf5bc92b07f5d9e1e1dd (patch)
tree1b48f8067214786c9e7d163d6ff7f0ddc4d33d95 /src/test/regress/sql
parent4cdf51e64627823088a3f94d21bafbb5fc87f9ea (diff)
downloadpostgresql-e97b8f2da9ee93f3f957bf5bc92b07f5d9e1e1dd.tar.gz
Add CREATE TRIGGER, CREATE INDEX, and CREATE SEQUENCE to the list of
expressions supported by CREATE SCHEMA. Also added the beginning of some regression tests for CREATE SCHEMA; plenty more work is needed here.
Diffstat (limited to 'src/test/regress/sql')
-rw-r--r--src/test/regress/sql/namespace.sql31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/test/regress/sql/namespace.sql b/src/test/regress/sql/namespace.sql
new file mode 100644
index 0000000000..919f72ada2
--- /dev/null
+++ b/src/test/regress/sql/namespace.sql
@@ -0,0 +1,31 @@
+--
+-- Regression tests for schemas (namespaces)
+--
+
+CREATE SCHEMA test_schema_1
+ CREATE UNIQUE INDEX abc_a_idx ON abc (a)
+
+ CREATE VIEW abc_view AS
+ SELECT a+1 AS a, b+1 AS b FROM abc
+
+ CREATE TABLE abc (
+ a serial,
+ b int UNIQUE
+ );
+
+-- verify that the objects were created
+SELECT COUNT(*) FROM pg_class WHERE relnamespace =
+ (SELECT oid FROM pg_namespace WHERE nspname = 'test_schema_1');
+
+INSERT INTO test_schema_1.abc DEFAULT VALUES;
+INSERT INTO test_schema_1.abc DEFAULT VALUES;
+INSERT INTO test_schema_1.abc DEFAULT VALUES;
+
+SELECT * FROM test_schema_1.abc;
+SELECT * FROM test_schema_1.abc_view;
+
+DROP SCHEMA test_schema_1 CASCADE;
+
+-- verify that the objects were dropped
+SELECT COUNT(*) FROM pg_class WHERE relnamespace =
+ (SELECT oid FROM pg_namespace WHERE nspname = 'test_schema_1');