diff options
author | Robert Haas <rhaas@postgresql.org> | 2011-04-20 21:35:15 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2011-04-20 21:38:47 -0400 |
commit | 68739ba856c52e6721d6cffec21f1bf0327a9a7b (patch) | |
tree | f0982dcba2eb0414a732582e29ae03995636a6fb /doc/src | |
parent | 520bcd9c9bb4d06627054e1c567bac1feb2da879 (diff) | |
download | postgresql-68739ba856c52e6721d6cffec21f1bf0327a9a7b.tar.gz postgresql-68739ba856c52e6721d6cffec21f1bf0327a9a7b.zip |
Allow ALTER TABLE name {OF type | NOT OF}.
This syntax allows a standalone table to be made into a typed table,
or a typed table to be made standalone. This is possibly a mildly
useful feature in its own right, but the real motivation for this
change is that we need it to make pg_upgrade work with typed tables.
This doesn't actually fix that problem, but it's necessary
infrastructure.
Noah Misch
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/alter_table.sgml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index c1948624d70..4e02438483b 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -63,6 +63,8 @@ ALTER TABLE <replaceable class="PARAMETER">name</replaceable> RESET ( <replaceable class="PARAMETER">storage_parameter</replaceable> [, ... ] ) INHERIT <replaceable class="PARAMETER">parent_table</replaceable> NO INHERIT <replaceable class="PARAMETER">parent_table</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> @@ -491,6 +493,30 @@ ALTER TABLE <replaceable class="PARAMETER">name</replaceable> </varlistentry> <varlistentry> + <term><literal>OF <replaceable class="PARAMETER">type_name</replaceable></literal></term> + <listitem> + <para> + This form links the table to a composite type as though <command>CREATE + TABLE OF</> had formed it. The table's list of column names and types + must precisely match that of the composite type; the presence of + an <literal>oid</> system column is permitted to differ. The table must + not inherit from any other table. These restrictions ensure + that <command>CREATE TABLE OF</> would permit an equivalent table + definition. + </para> + </listitem> + </varlistentry> + + <varlistentry> + <term><literal>NOT OF</literal></term> + <listitem> + <para> + This form dissociates a typed table from its type. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><literal>OWNER</literal></term> <listitem> <para> |