11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.19 2003/12/13 23:59:07 neilc Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.20 2004/01/10 23:28:44 neilc Exp $
33PostgreSQL documentation
44-->
55
@@ -20,7 +20,7 @@ PostgreSQL documentation
2020
2121 <refsynopsisdiv>
2222<synopsis>
23- CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name</replaceable> [ (<replaceable>column_name</replaceable> [, ...] ) ]
23+ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name</replaceable> [ (<replaceable>column_name</replaceable> [, ...] ) ] [ [ WITH | WITHOUT ] OIDS ]
2424 AS <replaceable>query</replaceable>
2525</synopsis>
2626 </refsynopsisdiv>
@@ -98,6 +98,20 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name
9898 </listitem>
9999 </varlistentry>
100100
101+ <varlistentry>
102+ <term><literal>WITH OIDS</literal></term>
103+ <term><literal>WITHOUT OIDS</literal></term>
104+ <listitem>
105+ <para>
106+ This optional clause specifies whether the table created by
107+ <command>CREATE TABLE AS</command> should include OIDs. If
108+ neither form of this clause if specified, the value of the
109+ <varname>default_with_oids</varname> configuration parameter is
110+ used.
111+ </para>
112+ </listitem>
113+ </varlistentry>
114+
101115 <varlistentry>
102116 <term><replaceable>query</replaceable></term>
103117 <listitem>
@@ -121,23 +135,30 @@ CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE <replaceable>table_name
121135 This command is functionally similar to <xref
122136 linkend="sql-selectinto" endterm="sql-selectinto-title">, but it is
123137 preferred since it is less likely to be confused with other uses of
124- the <command>SELECT INTO</command> syntax.
138+ the <command>SELECT INTO</> syntax. Furthermore, <command>CREATE
139+ TABLE AS</command> offers a superset of the functionality offerred
140+ by <command>SELECT INTO</command>.
125141 </para>
126142
127143 <para>
128- Prior to <productname>PostgreSQL</> 7.5, <command>CREATE TABLE
129- AS</command> always included OIDs in the table it
144+ Prior to <productname>PostgreSQL</productname > 7.5, <command>CREATE
145+ TABLE AS</command> always included OIDs in the table it
130146 produced. Furthermore, these OIDs were newly generated: they were
131147 distinct from the OIDs of any of the rows in the source tables of
132148 the <command>SELECT</command> or <command>EXECUTE</command>
133149 statement. Therefore, if <command>CREATE TABLE AS</command> was
134150 frequently executed, the OID counter would be rapidly
135- incremented. As of <productname>PostgreSQL</> 7.5, the inclusion of
136- OIDs in the table generated by <command>CREATE TABLE AS</command>
137- is controlled by the <varname>default_with_oids</varname>
138- configuration variable. This variable currently defaults to true,
139- but will likely default to false in a future release of
140- <productname>PostgreSQL</>.
151+ incremented. As of <productname>PostgresSQL</productname> 7.5,
152+ the <command>CREATE TABLE AS</command> command allows the user to
153+ explicitely specify whether OIDs should be included. If the
154+ presence of OIDs is not explicitely specified,
155+ the <varname>default_with_oids</varname> configuration variable is
156+ used. While this variable currently defaults to true, the default
157+ value may be changed in the future. Therefore, applications that
158+ require OIDs in the table created by <command>CREATE TABLE
159+ AS</command> should explicitely specify <literal>WITH
160+ OIDS</literal> to ensure compatibility with future versions
161+ of <productname>PostgreSQL</productname>.
141162 </para>
142163 </refsect1>
143164