summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2009-10-12 19:49:24 +0000
committerAndrew Dunstan <andrew@dunslane.net>2009-10-12 19:49:24 +0000
commitfaa1afc6c16631424579548a6e2fafb130f834f4 (patch)
treec41b0585535ab283ba0a1cc407b58e7be4548a33 /doc/src
parent0adaf4cb312fe3eff83e786d6a0b53ae2cdc9302 (diff)
downloadpostgresql-faa1afc6c16631424579548a6e2fafb130f834f4.tar.gz
CREATE LIKE INCLUDING COMMENTS and STORAGE, and INCLUDING ALL shortcut. Itagaki Takahiro.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_table.sgml27
1 files changed, 24 insertions, 3 deletions
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index dc9b6855d9..a63333cb6f 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.116 2009/09/18 05:00:41 petere Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.117 2009/10/12 19:49:24 adunstan Exp $
PostgreSQL documentation
-->
@@ -24,7 +24,7 @@ PostgreSQL documentation
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PARAMETER">table_name</replaceable> ( [
{ <replaceable class="PARAMETER">column_name</replaceable> <replaceable class="PARAMETER">data_type</replaceable> [ DEFAULT <replaceable>default_expr</replaceable> ] [ <replaceable class="PARAMETER">column_constraint</replaceable> [ ... ] ]
| <replaceable>table_constraint</replaceable>
- | LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES } ] ... }
+ | LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES | STORAGE | COMMENTS | ALL } ] ... }
[, ... ]
] )
[ INHERITS ( <replaceable>parent_table</replaceable> [, ... ] ) ]
@@ -230,6 +230,10 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PAR
will always be chosen for it.
</para>
+ <para>
+ Column storage parameters are also copied from parent tables.
+ </para>
+
<!--
<para>
<productname>PostgreSQL</> automatically allows the
@@ -247,7 +251,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PAR
</varlistentry>
<varlistentry>
- <term><literal>LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES } ]</literal></term>
+ <term><literal>LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES | STORAGE | COMMENTS | ALL } ]</literal></term>
<listitem>
<para>
The <literal>LIKE</literal> clause specifies a table from which
@@ -281,6 +285,23 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable class="PAR
specified.
</para>
<para>
+ Storage parameters for the copied column definitions will only be copied
+ if <literal>INCLUDING STORAGE</literal> is specified. The default
+ behavior is to exclude storage parameters, resulting in the copied
+ columns in the new table having type-specific default parameters. For
+ more on storage parameters, see <xref linkend="storage-toast">.
+ </para>
+ <para>
+ Comments for the copied column, constraint, index and columns of index
+ definitions will only be copied if <literal>INCLUDING COMMENTS</literal>
+ is specified. The default behavior is to exclude comments, resulting in
+ the copied columns and constraints in the new table having no comments.
+ </para>
+ <para>
+ <literal>INCLUDING ALL</literal> is an abbreviated form of
+ <literal>INCLUDING DEFAULTS INCLUDING CONSTRAINTS INCLUDING INDEXES INCLUDING STORAGE INCLUDING COMMENTS</literal>.
+ </para>
+ <para>
Note also that unlike <literal>INHERITS</literal>, copied columns and
constraints are not merged with similarly named columns and constraints.
If the same name is specified explicitly or in another