diff options
author | Alvaro Herrera | 2014-08-22 18:27:00 +0000 |
---|---|---|
committer | Alvaro Herrera | 2014-08-22 18:27:00 +0000 |
commit | f41872d0c1239d36ab03393c39ec0b70e9ee2a3c (patch) | |
tree | 4c07e9f8a6b0a3d4c9d1e19ca5595c39e5f6e43a /doc/src | |
parent | 01d15a2677c738489e62295924298ef8a72528a8 (diff) |
Implement ALTER TABLE .. SET LOGGED / UNLOGGED
This enables changing permanent (logged) tables to unlogged and
vice-versa.
(Docs for ALTER TABLE / SET TABLESPACE got shuffled in an order that
hopefully makes more sense than the original.)
Author: Fabrízio de Royes Mello
Reviewed by: Christoph Berg, Andres Freund, Thom Brown
Some tweaking by Álvaro Herrera
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/alter_table.sgml | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 0e7b99c934c..5bbf4fb3595 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -63,6 +63,8 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable> SET WITHOUT CLUSTER SET WITH OIDS SET WITHOUT OIDS + SET TABLESPACE <replaceable class="PARAMETER">new_tablespace</replaceable> + SET {LOGGED | UNLOGGED} SET ( <replaceable class="PARAMETER">storage_parameter</replaceable> = <replaceable class="PARAMETER">value</replaceable> [, ... ] ) RESET ( <replaceable class="PARAMETER">storage_parameter</replaceable> [, ... ] ) INHERIT <replaceable class="PARAMETER">parent_table</replaceable> @@ -70,7 +72,6 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable> OF <replaceable class="PARAMETER">type_name</replaceable> NOT OF OWNER TO <replaceable class="PARAMETER">new_owner</replaceable> - SET TABLESPACE <replaceable class="PARAMETER">new_tablespace</replaceable> REPLICA IDENTITY {DEFAULT | USING INDEX <replaceable class="PARAMETER">index_name</replaceable> | FULL | NOTHING} <phrase>and <replaceable class="PARAMETER">table_constraint_using_index</replaceable> is:</phrase> @@ -479,6 +480,42 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable> </varlistentry> <varlistentry> + <term><literal>SET TABLESPACE</literal></term> + <listitem> + <para> + This form changes the table's tablespace to the specified tablespace and + moves the data file(s) associated with the table to the new tablespace. + Indexes on the table, if any, are not moved; but they can be moved + separately with additional <literal>SET TABLESPACE</literal> commands. + All tables in the current database in a tablespace can be moved by using + the <literal>ALL IN TABLESPACE</literal> form, which will lock all tables + to be moved first and then move each one. This form also supports + <literal>OWNED BY</literal>, which will only move tables owned by the + roles specified. If the <literal>NOWAIT</literal> option is specified + then the command will fail if it is unable to acquire all of the locks + required immediately. Note that system catalogs are not moved by this + command, use <command>ALTER DATABASE</command> or explicit + <command>ALTER TABLE</command> invocations instead if desired. The + <literal>information_schema</literal> relations are not considered part + of the system catalogs and will be moved. + See also + <xref linkend="SQL-CREATETABLESPACE">. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><literal>SET {LOGGED | UNLOGGED}</literal></term> + <listitem> + <para> + This form changes the table from unlogged to logged or vice-versa + (see <xref linkend="SQL-CREATETABLE-UNLOGGED">). It cannot be applied + to a temporary table. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><literal>SET ( <replaceable class="PARAMETER">storage_parameter</replaceable> = <replaceable class="PARAMETER">value</replaceable> [, ... ] )</literal></term> <listitem> <para> @@ -591,31 +628,6 @@ ALTER TABLE ALL IN TABLESPACE <replaceable class="PARAMETER">name</replaceable> </listitem> </varlistentry> - <varlistentry> - <term><literal>SET TABLESPACE</literal></term> - <listitem> - <para> - This form changes the table's tablespace to the specified tablespace and - moves the data file(s) associated with the table to the new tablespace. - Indexes on the table, if any, are not moved; but they can be moved - separately with additional <literal>SET TABLESPACE</literal> commands. - All tables in the current database in a tablespace can be moved by using - the <literal>ALL IN TABLESPACE</literal> form, which will lock all tables - to be moved first and then move each one. This form also supports - <literal>OWNED BY</literal>, which will only move tables owned by the - roles specified. If the <literal>NOWAIT</literal> option is specified - then the command will fail if it is unable to acquire all of the locks - required immediately. Note that system catalogs are not moved by this - command, use <command>ALTER DATABASE</command> or explicit - <command>ALTER TABLE</command> invocations instead if desired. The - <literal>information_schema</literal> relations are not considered part - of the system catalogs and will be moved. - See also - <xref linkend="SQL-CREATETABLESPACE">. - </para> - </listitem> - </varlistentry> - <varlistentry id="SQL-CREATETABLE-REPLICA-IDENTITY"> <term><literal>REPLICA IDENTITY</literal></term> <listitem> |