summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane2004-11-05 19:17:13 +0000
committerTom Lane2004-11-05 19:17:13 +0000
commit98e8b4805324d8ba0b196b8ffaafd5ddd3051ea1 (patch)
tree61d027f5621f3ff37a675fb2e9982e0d28a81242 /src/test
parent0ed3c7665e2fe46efd3eef936a1265be2ec6707f (diff)
Create 'default_tablespace' GUC variable that supplies a TABLESPACE
clause implicitly whenever one is not given explicitly. Remove concept of a schema having an associated tablespace, and simplify the rules for selecting a default tablespace for a table or index. It's now just (a) explicit TABLESPACE clause; (b) default_tablespace if that's not an empty string; (c) database's default. This will allow pg_dump to use SET commands instead of tablespace clauses to determine object locations (but I didn't actually make it do so). All per recent discussions.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/input/tablespace.source12
-rw-r--r--src/test/regress/output/tablespace.source16
2 files changed, 8 insertions, 20 deletions
diff --git a/src/test/regress/input/tablespace.source b/src/test/regress/input/tablespace.source
index 460d4433a8..d094bd7081 100644
--- a/src/test/regress/input/tablespace.source
+++ b/src/test/regress/input/tablespace.source
@@ -1,15 +1,11 @@
-- create a tablespace we can use
CREATE TABLESPACE testspace LOCATION '@testtablespace@';
--- create a schema in the tablespace
-CREATE SCHEMA testschema TABLESPACE testspace;
-
--- sanity check
-SELECT nspname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_namespace n
- where n.nsptablespace = t.oid and n.nspname = 'testschema';
+-- create a schema we can use
+CREATE SCHEMA testschema;
-- try a table
-CREATE TABLE testschema.foo (i int);
+CREATE TABLE testschema.foo (i int) TABLESPACE testspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo';
@@ -17,7 +13,7 @@ INSERT INTO testschema.foo VALUES(1);
INSERT INTO testschema.foo VALUES(2);
-- index
-CREATE INDEX foo_idx on testschema.foo(i);
+CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE testspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo_idx';
diff --git a/src/test/regress/output/tablespace.source b/src/test/regress/output/tablespace.source
index 43044a2bcf..42c4bc628d 100644
--- a/src/test/regress/output/tablespace.source
+++ b/src/test/regress/output/tablespace.source
@@ -1,17 +1,9 @@
-- create a tablespace we can use
CREATE TABLESPACE testspace LOCATION '@testtablespace@';
--- create a schema in the tablespace
-CREATE SCHEMA testschema TABLESPACE testspace;
--- sanity check
-SELECT nspname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_namespace n
- where n.nsptablespace = t.oid and n.nspname = 'testschema';
- nspname | spcname
-------------+-----------
- testschema | testspace
-(1 row)
-
+-- create a schema we can use
+CREATE SCHEMA testschema;
-- try a table
-CREATE TABLE testschema.foo (i int);
+CREATE TABLE testschema.foo (i int) TABLESPACE testspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo';
relname | spcname
@@ -22,7 +14,7 @@ SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
INSERT INTO testschema.foo VALUES(1);
INSERT INTO testschema.foo VALUES(2);
-- index
-CREATE INDEX foo_idx on testschema.foo(i);
+CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE testspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo_idx';
relname | spcname