@ -1,5 +1,5 @@
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.30 2005/10/15 20:12:33 neilc Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.31 2005/11/01 21:09:50 tgl Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
@ -20,7 +20,8 @@ PostgreSQL documentation
<refsynopsisdiv>
<refsynopsisdiv>
<synopsis>
<synopsis>
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name</replaceable> [ (<replaceable>column_name</replaceable> [, ...] ) ] [ [ WITH | WITHOUT ] OIDS ]
CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name</replaceable>
[ (<replaceable>column_name</replaceable> [, ...] ) ] [ [ WITH | WITHOUT ] OIDS ]
AS <replaceable>query</replaceable>
AS <replaceable>query</replaceable>
</synopsis>
</synopsis>
</refsynopsisdiv>
</refsynopsisdiv>
@ -143,17 +144,17 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name
<para>
<para>
Prior to <productname>PostgreSQL</productname> 8.0, <command>CREATE
Prior to <productname>PostgreSQL</productname> 8.0, <command>CREATE
TABLE AS</command> always included OIDs in the table it
TABLE AS</command> always included OIDs in the table it
produc ed. As of <productname>PostgreSQL</productname> 8.0,
creat ed. As of <productname>PostgreSQL</productname> 8.0,
the <command>CREATE TABLE AS</command> command allows the user to
the <command>CREATE TABLE AS</command> command allows the user to
explicitly specify whether OIDs should be included. If the
explicitly specify whether OIDs should be included. If the
presence of OIDs is not explicitly specified,
presence of OIDs is not explicitly specified,
the <xref linkend="guc-default-with-oids"> configuration variable is
the <xref linkend="guc-default-with-oids"> configuration variable is
used. While this variable currently defaults to true, the default
used. As of <productname>PostgreSQL</productname> 8.1,
value may be changed in the future. Therefore, applications that
this variable is false by default, so the default behavior is not
identical to pre-8.0 releases. Applications that
require OIDs in the table created by <command>CREATE TABLE
require OIDs in the table created by <command>CREATE TABLE
AS</command> should explicitly specify <literal>WITH
AS</command> should explicitly specify <literal>WITH OIDS</literal>
OIDS</literal> to ensure compatibility with future versions
to ensure proper behavior.
of <productname>PostgreSQL</productname>.
</para>
</para>
</refsect1>
</refsect1>
@ -175,10 +176,8 @@ CREATE TABLE films_recent AS
<title>Compatibility</title>
<title>Compatibility</title>
<para>
<para>
<command>CREATE TABLE AS</command> is specified by the SQL:2003
<command>CREATE TABLE AS</command> conforms to the <acronym>SQL</acronym>
standard. There are some small differences between the definition
standard, with the following exceptions:
of the command in SQL:2003 and its implementation in
<productname>PostgreSQL</>:
<itemizedlist spacing="compact">
<itemizedlist spacing="compact">
<listitem>
<listitem>
@ -198,8 +197,26 @@ CREATE TABLE films_recent AS
<listitem>
<listitem>
<para>
<para>
The standard defines a <literal>WITH DATA</literal> clause;
The standard defines a <literal>WITH [ NO ] DATA</literal> clause;
this is not currently implemented by <productname>PostgreSQL</>.
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.
</para>
</listitem>
<listitem>
<para>
<literal>WITH/WITHOUT OIDS</> is a <productname>PostgreSQL</>
extension.
</para>
</listitem>
<listitem>
<para>
<productname>PostgreSQL</> handles temporary tables in a way
rather different from the standard; see
<xref linkend="sql-createtable" endterm="sql-createtable-title">
for details.
</para>
</para>
</listitem>
</listitem>
</itemizedlist>
</itemizedlist>