summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/src/sgml/ref/create_table.sgml14
-rw-r--r--doc/src/sgml/ref/create_view.sgml47
2 files changed, 43 insertions, 18 deletions
diff --git a/doc/src/sgml/ref/create_table.sgml b/doc/src/sgml/ref/create_table.sgml
index 192e64d69b5..191f29ccd4d 100644
--- a/doc/src/sgml/ref/create_table.sgml
+++ b/doc/src/sgml/ref/create_table.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.91 2005/01/22 23:22:17 momjian Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_table.sgml,v 1.92 2005/02/02 06:35:59 neilc Exp $
PostgreSQL documentation
-->
@@ -66,12 +66,12 @@ and <replaceable class="PARAMETER">table_constraint</replaceable> is:
<para>
If a schema name is given (for example, <literal>CREATE TABLE
- myschema.mytable ...</>) then the table is created in the
- specified schema. Otherwise it is created in the current schema.
- Temporary tables exist in a special schema, so a schema name may not be
- given when creating a temporary table.
- The table name must be distinct from the name of any other table,
- sequence, index, or view in the same schema.
+ myschema.mytable ...</>) then the table is created in the specified
+ schema. Otherwise it is created in the current schema. Temporary
+ tables exist in a special schema, so a schema name may not be given
+ when creating a temporary table. The name of the table must be
+ distinct from the name of any other table, sequence, index, or view
+ in the same schema.
</para>
<para>
diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml
index 29578216918..8c18378dee6 100644
--- a/doc/src/sgml/ref/create_view.sgml
+++ b/doc/src/sgml/ref/create_view.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_view.sgml,v 1.29 2005/01/04 00:39:53 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_view.sgml,v 1.30 2005/02/02 06:35:59 neilc Exp $
PostgreSQL documentation
-->
@@ -20,7 +20,7 @@ PostgreSQL documentation
<refsynopsisdiv>
<synopsis>
-CREATE [ OR REPLACE ] VIEW <replaceable class="PARAMETER">name</replaceable> [ ( <replaceable
+CREATE [ OR REPLACE ] [ TEMP | TEMPORARY ] VIEW <replaceable class="PARAMETER">name</replaceable> [ ( <replaceable
class="PARAMETER">column_name</replaceable> [, ...] ) ] AS <replaceable class="PARAMETER">query</replaceable>
</synopsis>
</refsynopsisdiv>
@@ -43,10 +43,12 @@ class="PARAMETER">column_name</replaceable> [, ...] ) ] AS <replaceable class="P
<para>
If a schema name is given (for example, <literal>CREATE VIEW
- myschema.myview ...</>) then the view is created in the
- specified schema. Otherwise it is created in the current schema.
- The view name must be distinct from the name of any other view, table,
- sequence, or index in the same schema.
+ myschema.myview ...</>) then the view is created in the specified
+ schema. Otherwise it is created in the current schema. Temporary
+ views exist in a special schema, so a schema name may not be given
+ when creating a temporary view. The name of the view must be
+ distinct from the name of any other view, table, sequence, or index
+ in the same schema.
</para>
</refsect1>
@@ -55,6 +57,28 @@ class="PARAMETER">column_name</replaceable> [, ...] ) ] AS <replaceable class="P
<variablelist>
<varlistentry>
+ <term><literal>TEMPORARY</> or <literal>TEMP</></term>
+ <listitem>
+ <para>
+ If specified, the view is created as a temporary view.
+ Temporary views are automatically dropped at the end of the
+ current session. Temporary views are automatically placed in the
+ current backend's local temporary schema, so it is illegal to
+ specify a schema-qualified name for a temporary view. Existing
+ permanent relations with the same name are not visible to the
+ current session while the temporary view exists, unless they are
+ referenced with schema-qualified names.
+ </para>
+
+ <para>
+ If any of the base tables referenced by the view are temporary,
+ the view is created as a temporary view (whether
+ <literal>TEMPORARY</literal> is specified or not).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><replaceable class="parameter">name</replaceable></term>
<listitem>
<para>
@@ -102,7 +126,8 @@ class="PARAMETER">column_name</replaceable> [, ...] ) ] AS <replaceable class="P
</para>
<para>
- Use the <command>DROP VIEW</command> statement to drop views.
+ Use the <xref linkend="sql-dropview" endterm="sql-dropview-title">
+ statement to drop views.
</para>
<para>
@@ -153,7 +178,7 @@ CREATE VIEW comedies AS
<synopsis>
CREATE VIEW <replaceable class="parameter">name</replaceable> [ ( <replaceable class="parameter">column</replaceable> [, ...] ) ]
AS query
- [ WITH [ CASCADE | LOCAL ] CHECK OPTION ]
+ [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]
</synopsis>
</para>
@@ -184,12 +209,12 @@ CREATE VIEW <replaceable class="parameter">name</replaceable> [ ( <replaceable c
</varlistentry>
<varlistentry>
- <term><literal>CASCADE</literal></term>
+ <term><literal>CASCADED</literal></term>
<listitem>
<para>
Check for integrity on this view and on any dependent
- view. <literal>CASCADE</> is assumed if neither
- <literal>CASCADE</> nor <literal>LOCAL</> is specified.
+ view. <literal>CASCADED</> is assumed if neither
+ <literal>CASCADED</> nor <literal>LOCAL</> is specified.
</para>
</listitem>
</varlistentry>