aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2008-10-28 14:09:45 +0000
committerPeter Eisentraut <peter_e@gmx.net>2008-10-28 14:09:45 +0000
commit8ecd5351691210ba5b536cd4c1251ea1fce090bb (patch)
tree0e31a7de3a1d21e3b46db6435e6a30dc76b52bc5 /doc/src
parent53a5026b5cb359ec31e81fa6b20a69b053b87569 (diff)
downloadpostgresql-8ecd5351691210ba5b536cd4c1251ea1fce090bb.tar.gz
postgresql-8ecd5351691210ba5b536cd4c1251ea1fce090bb.zip
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/ref/create_table_as.sgml25
1 files changed, 17 insertions, 8 deletions
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 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.37 2007/06/03 17:06:12 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.38 2008/10/28 14:09:44 petere Exp $
PostgreSQL documentation
-->
@@ -26,6 +26,7 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]
[ TABLESPACE <replaceable class="PARAMETER">tablespace</replaceable> ]
AS <replaceable>query</replaceable>
+ [ WITH [ NO ] DATA ]
</synopsis>
</refsynopsisdiv>
@@ -201,6 +202,18 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name
</para>
</listitem>
</varlistentry>
+
+ <varlistentry>
+ <term><literal>WITH [ NO ] DATA</></term>
+ <listitem>
+ <para>
+ 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.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
@@ -265,7 +278,7 @@ CREATE TEMP TABLE films_recent WITH (OIDS) ON COMMIT DROP AS
<para>
<command>CREATE TABLE AS</command> conforms to the <acronym>SQL</acronym>
- standard, with the following exceptions:
+ standard. The following are nonstandard extensions:
<itemizedlist spacing="compact">
<listitem>
@@ -278,12 +291,8 @@ CREATE TEMP TABLE films_recent WITH (OIDS) ON COMMIT DROP AS
<listitem>
<para>
- The standard defines a <literal>WITH [ NO ] DATA</literal> clause;
- this is not currently implemented by <productname>PostgreSQL</>.
- The behavior provided by <productname>PostgreSQL</> is equivalent
- to the standard's <literal>WITH DATA</literal> case.
- <literal>WITH NO DATA</literal> can be simulated by appending
- <literal>LIMIT 0</> to the query.
+ In the standard, the <literal>WITH [ NO ] DATA</literal> clause
+ is required; in PostgreSQL it is optional.
</para>
</listitem>