Skip to content

Commit aee52a6

Browse files
committed
Document TEMP option.
1 parent 23e41fb commit aee52a6

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

doc/src/sgml/ref/create_table_as.sgml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.4 2000/12/25 23:15:26 petere Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table_as.sgml,v 1.5 2001/03/03 22:11:40 tgl Exp $
33
Postgres documentation
44
-->
55

@@ -20,10 +20,10 @@ Postgres documentation
2020
</refnamediv>
2121
<refsynopsisdiv>
2222
<refsynopsisdivinfo>
23-
<date>1999-07-20</date>
23+
<date>2001-03-03</date>
2424
</refsynopsisdivinfo>
2525
<synopsis>
26-
CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceable> [, ...] ) ]
26+
CREATE [ TEMPORARY | TEMP ] TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceable> [, ...] ) ]
2727
AS <replaceable>select_clause</replaceable>
2828
</synopsis>
2929

@@ -37,6 +37,20 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
3737
<para>
3838

3939
<variablelist>
40+
<varlistentry>
41+
<term>TEMPORARY or TEMP</term>
42+
<listitem>
43+
<para>
44+
If specified, the table is created only for this session, and is
45+
automatically dropped on session exit.
46+
Existing permanent tables with the same name are not visible
47+
(in this session) while the temporary table exists.
48+
Any indexes created on a temporary table are automatically
49+
temporary as well.
50+
</para>
51+
</listitem>
52+
</varlistentry>
53+
4054
<varlistentry>
4155
<term><replaceable>table</replaceable></term>
4256
<listitem>
@@ -51,7 +65,9 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
5165
<listitem>
5266
<para>
5367
The name of a column. Multiple column names can be specified using
54-
a comma-delimited list of column names.
68+
a comma-delimited list of column names. If column names are not
69+
provided, they are taken from the output column names of the
70+
SELECT query.
5571
</para>
5672
</listitem>
5773
</varlistentry>
@@ -94,7 +110,7 @@ CREATE TABLE <replaceable>table</replaceable> [ (<replaceable>column</replaceabl
94110
<para>
95111
<command>CREATE TABLE AS</command> enables a table to be created
96112
from the contents of an existing table.
97-
It is functionality equivalent to
113+
It is functionally equivalent to
98114
<xref linkend="sql-selectinto" endterm="sql-selectinto-title">,
99115
but with perhaps a more direct syntax.
100116
</para>

0 commit comments

Comments
 (0)