This section once started out small but has now grown quite a bit and
needs a bit of structure.
Rewrite as list, add documentation of EXCLUDING, and improve the
documentation of INCLUDING ALL instead of just listing all the options
again.
per report from Yugo Nagata that EXCLUDING was not documented, that part
reviewed by Daniel Gustafsson, most of the rewrite was by me
Comments for the copied columns, constraints, and indexes
Extended statistics are copied to the new table.
will be copied only 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>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>INCLUDING STORAGE</literal></term>
<listitem>
<para>
<para>
<literal>INCLUDING ALL</literal> is an abbreviated form of
<literal>STORAGE</literal> settings for the copied column
<literal>INCLUDING COMMENTS INCLUDING CONSTRAINTS INCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING INDEXES INCLUDING STATISTICS INCLUDING STORAGE</literal>.
definitions will be copied. The default behavior is to exclude
<literal>STORAGE</literal> settings, resulting in the copied columns
in the new table having type-specific default settings. For more on
<literal>STORAGE</literal> settings, see <xref
linkend="storage-toast"/>.
</para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>INCLUDING ALL</literal></term>
<listitem>
<para>
<para>
Note that unlike <literal>INHERITS</literal>, columns and
<literal>INCLUDING ALL</literal> is an abbreviated form selecting
constraints copied by <literal>LIKE</literal> are not merged with similarly
all the available individual options. (It could be useful to write
named columns and constraints.
individual <literal>EXCLUDING</literal> clauses after
If the same name is specified explicitly or in another
<literal>INCLUDING ALL</literal> to select all but some specific
<literal>LIKE</literal> clause, an error is signaled.
options.)
</para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
<para>
The <literal>LIKE</literal> clause can also be used to copy column
The <literal>LIKE</literal> clause can also be used to copy column
definitions from views, foreign tables, or composite types.
definitions from views, foreign tables, or composite types.