From 8ecd5351691210ba5b536cd4c1251ea1fce090bb Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 28 Oct 2008 14:09:45 +0000 Subject: Add WITH [NO] DATA clause to CREATE TABLE AS, per SQL. Also, since WITH is now a reserved word, simplify the token merging code to only deal with WITH_TIME. by Tom Lane and myself --- doc/src/sgml/ref/create_table_as.sgml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/create_table_as.sgml b/doc/src/sgml/ref/create_table_as.sgml index edc9ce5e6c5..c3f3c230aa5 100644 --- a/doc/src/sgml/ref/create_table_as.sgml +++ b/doc/src/sgml/ref/create_table_as.sgml @@ -1,5 +1,5 @@ @@ -26,6 +26,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name [ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] [ TABLESPACE tablespace ] AS query + [ WITH [ NO ] DATA ] @@ -201,6 +202,18 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name + + + WITH [ NO ] DATA + + + This clause specifies whether or not the data produced by the query + should be copied into the new table. If not, only the table structure + is copied. The default is to copy the data. + + + + @@ -265,7 +278,7 @@ CREATE TEMP TABLE films_recent WITH (OIDS) ON COMMIT DROP AS CREATE TABLE AS conforms to the SQL - standard, with the following exceptions: + standard. The following are nonstandard extensions: @@ -278,12 +291,8 @@ CREATE TEMP TABLE films_recent WITH (OIDS) ON COMMIT DROP AS - The standard defines a WITH [ NO ] DATA clause; - this is not currently implemented by PostgreSQL. - The behavior provided by PostgreSQL is equivalent - to the standard's WITH DATA case. - WITH NO DATA can be simulated by appending - LIMIT 0 to the query. + In the standard, the WITH [ NO ] DATA clause + is required; in PostgreSQL it is optional. -- cgit v1.2.3