Document TEMP option.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Mar 2001 22:11:40 +0000 (22:11 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 3 Mar 2001 22:11:40 +0000 (22:11 +0000)
doc/src/sgml/ref/create_table_as.sgml

index 71e7e3f14ca7e471c50174e8ce8ad9884f84f4c8..c9689bb3ea82b4d066f5f648e97993eb61fe1194 100644 (file)
@@ -20,10 +20,10 @@ Postgres documentation
  </refnamediv>
  <refsynopsisdiv>
   <refsynopsisdivinfo>
-   <date>1999-07-20</date>
+   <date>2001-03-03</date>
   </refsynopsisdivinfo>
   <synopsis>
-CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceable> [, ...] ) ]
+CREATE [ TEMPORARY | TEMP ] TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceable> [, ...] ) ]
      AS <replaceable>select_clause</replaceable>
   </synopsis>
   
@@ -37,6 +37,20 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
    <para>
    
    <variablelist>
+     <varlistentry>
+      <term>TEMPORARY or TEMP</term>
+      <listitem>
+       <para>
+       If specified, the table is created only for this session, and is
+       automatically dropped on session exit.
+       Existing permanent tables with the same name are not visible
+       (in this session) while the temporary table exists.
+       Any indexes created on a temporary table are automatically
+       temporary as well.
+       </para>
+      </listitem>
+     </varlistentry>
+
     <varlistentry>
      <term><replaceable>table</replaceable></term>
      <listitem>
@@ -51,7 +65,9 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
       <listitem>
        <para>
        The name of a column. Multiple column names can be specified using
-       a comma-delimited list of column names.
+       a comma-delimited list of column names.  If column names are not
+       provided, they are taken from the output column names of the
+       SELECT query.
        </para>
       </listitem>
      </varlistentry>
@@ -94,7 +110,7 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
   <para>
    <command>CREATE TABLE AS</command> enables a table to be created
    from the contents of an existing table.
-   It is functionality equivalent to
+   It is functionally equivalent to
    <xref linkend="sql-selectinto" endterm="sql-selectinto-title">,
    but with perhaps a more direct syntax.
   </para>