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
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.
Extended statistics are copied to the new table.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>INCLUDING STORAGE</literal></term>
<listitem>
<para>
<literal>INCLUDING ALL</literal> is an abbreviated form of
<literal>INCLUDING COMMENTS INCLUDING CONSTRAINTS INCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING INDEXES INCLUDING STATISTICS INCLUDING STORAGE</literal>.
<literal>STORAGE</literal> settings for the copied column
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>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>INCLUDING ALL</literal></term>
<listitem>
<para>
Note that unlike <literal>INHERITS</literal>, columns and
constraints copied by <literal>LIKE</literal> are not merged with similarly
named columns and constraints.
If the same name is specified explicitly or in another
<literal>LIKE</literal> clause, an error is signaled.
<literal>INCLUDING ALL</literal> is an abbreviated form selecting
all the available individual options. (It could be useful to write
individual <literal>EXCLUDING</literal> clauses after
<literal>INCLUDING ALL</literal> to select all but some specific
options.)
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
The <literal>LIKE</literal> clause can also be used to copy column
definitions from views, foreign tables, or composite types.