aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2007-07-17 05:02:03 +0000
committerNeil Conway <neilc@samurai.com>2007-07-17 05:02:03 +0000
commit474774918b4b55e774d2fcc1d7e94c8c632fadef (patch)
treee66fbdcfb273895d951edbabf44cee998327000a /doc/src
parent77d27e43e5f204736175a2f6fc45959e0dcb5fd8 (diff)
downloadpostgresql-474774918b4b55e774d2fcc1d7e94c8c632fadef.tar.gz
postgresql-474774918b4b55e774d2fcc1d7e94c8c632fadef.zip
Implement CREATE TABLE LIKE ... INCLUDING INDEXES. Patch from NikhilS,
based in part on an earlier patch from Trevor Hardcastle, and reviewed by myself.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_table.sgml13
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 064769cee0a..68e8f045e6a 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.108 2007/06/03 17:06:03 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.109 2007/07/17 05:02:00 neilc Exp $
PostgreSQL documentation
-->
@@ -23,7 +23,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 class="PARAMETER">column_constraint</replaceable> [ ... ] ]
| <replaceable>table_constraint</replaceable>
- | LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS } ] ... }
+ | LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES } ] ... }
[, ... ]
] )
[ INHERITS ( <replaceable>parent_table</replaceable> [, ... ] ) ]
@@ -237,7 +237,7 @@ and <replaceable class="PARAMETER">table_constraint</replaceable> is:
</varlistentry>
<varlistentry>
- <term><literal>LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS } ]</literal></term>
+ <term><literal>LIKE <replaceable>parent_table</replaceable> [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES } ]</literal></term>
<listitem>
<para>
The <literal>LIKE</literal> clause specifies a table from which
@@ -266,10 +266,15 @@ and <replaceable class="PARAMETER">table_constraint</replaceable> is:
requested, all check constraints are copied.
</para>
<para>
+ Any indexes on the original table will not be created on the new
+ table, unless the <literal>INCLUDING INDEXES</literal> clause is
+ specified.
+ </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
- <literal>LIKE</literal> clause an error is signalled.
+ <literal>LIKE</literal> clause, an error is signalled.
</para>
</listitem>
</varlistentry>