From 474774918b4b55e774d2fcc1d7e94c8c632fadef Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Tue, 17 Jul 2007 05:02:03 +0000 Subject: Implement CREATE TABLE LIKE ... INCLUDING INDEXES. Patch from NikhilS, based in part on an earlier patch from Trevor Hardcastle, and reviewed by myself. --- doc/src/sgml/ref/create_table.sgml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'doc/src') 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 @@ @@ -23,7 +23,7 @@ PostgreSQL documentation CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name ( [ { column_name data_type [ DEFAULT default_expr ] [ column_constraint [ ... ] ] | table_constraint - | LIKE parent_table [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS } ] ... } + | LIKE parent_table [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES } ] ... } [, ... ] ] ) [ INHERITS ( parent_table [, ... ] ) ] @@ -237,7 +237,7 @@ and table_constraint is: - LIKE parent_table [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS } ] + LIKE parent_table [ { INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | INDEXES } ] The LIKE clause specifies a table from which @@ -265,11 +265,16 @@ and table_constraint is: column constraints and table constraints — when constraints are requested, all check constraints are copied. + + Any indexes on the original table will not be created on the new + table, unless the INCLUDING INDEXES clause is + specified. + Note also that unlike INHERITS, copied columns and constraints are not merged with similarly named columns and constraints. If the same name is specified explicitly or in another - LIKE clause an error is signalled. + LIKE clause, an error is signalled. -- cgit v1.2.3