From 6517f377d65dfb385d589edaa423aef0d1cf5a52 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 7 Nov 2008 18:25:07 +0000 Subject: Implement ALTER DATABASE SET TABLESPACE to move a whole database (or at least as much of it as lives in its default tablespace) to a new tablespace. Guillaume Lelarge, with some help from Bernd Helmle and Tom Lane --- doc/src/sgml/ref/alter_database.sgml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/alter_database.sgml b/doc/src/sgml/ref/alter_database.sgml index d16cc2fdad1..b7b8f43776f 100644 --- a/doc/src/sgml/ref/alter_database.sgml +++ b/doc/src/sgml/ref/alter_database.sgml @@ -1,5 +1,5 @@ @@ -30,6 +30,8 @@ ALTER DATABASE name RENAME TO name OWNER TO new_owner +ALTER DATABASE name SET TABLESPACE new_tablespace + ALTER DATABASE name SET configuration_parameter { TO | = } { value | DEFAULT } ALTER DATABASE name SET configuration_parameter FROM CURRENT ALTER DATABASE name RESET configuration_parameter @@ -67,6 +69,15 @@ ALTER DATABASE name RESET ALL (Note that superusers have all these privileges automatically.) + + The fourth form changes the default tablespace of the database. + Only the database owner or a superuser can do this; you must also have + create privilege for the new tablespace. + This command physically moves any tables or indexes in the database's old + default tablespace to the new tablespace. Note that tables and indexes + in non-default tablespaces are not affected. + + The remaining forms change the session default for a run-time configuration variable for a PostgreSQL @@ -122,6 +133,15 @@ ALTER DATABASE name RESET ALL + + new_tablespace + + + The new default tablespace of the database. + + + + configuration_parameter value @@ -189,6 +209,7 @@ ALTER DATABASE test SET enable_indexscan TO off; + -- cgit v1.2.3