mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Another try at correctly explaining the difference between Postgres and
SQL92 temp tables. Possibly I got it right this time.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.65 2003/04/14 15:40:02 tgl Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_table.sgml,v 1.66 2003/04/14 18:08:58 tgl Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -828,14 +828,14 @@ CREATE TABLE distributors (
|
|||||||
<para>
|
<para>
|
||||||
Although the syntax of <literal>CREATE TEMPORARY TABLE</literal>
|
Although the syntax of <literal>CREATE TEMPORARY TABLE</literal>
|
||||||
resembles that of SQL92, the effect is not the same. In the standard,
|
resembles that of SQL92, the effect is not the same. In the standard,
|
||||||
temporary tables are associated with modules; a temporary table is created
|
temporary tables are defined just once and automatically exist (starting
|
||||||
just once and automatically exists (starting with empty contents) in every
|
with empty contents) in every session that needs them.
|
||||||
session that uses the module.
|
<productname>PostgreSQL</productname> instead
|
||||||
<productname>PostgreSQL</productname> does not have modules, and
|
|
||||||
requires each session to issue its own <literal>CREATE TEMPORARY
|
requires each session to issue its own <literal>CREATE TEMPORARY
|
||||||
TABLE</literal> command for each temporary table to be used.
|
TABLE</literal> command for each temporary table to be used. This allows
|
||||||
The notion of <literal>GLOBAL</literal> temporary tables found in SQL92
|
different sessions to use the same temporary table name for different
|
||||||
is not in <productname>PostgreSQL</productname> at all.
|
purposes, whereas the spec's approach constrains all instances of a
|
||||||
|
given temporary table name to have the same table structure.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
<note>
|
||||||
@ -846,6 +846,13 @@ CREATE TABLE distributors (
|
|||||||
</para>
|
</para>
|
||||||
</note>
|
</note>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
SQL92's distinction between global and local temporary tables
|
||||||
|
is not in <productname>PostgreSQL</productname>, since that distinction
|
||||||
|
depends on the concept of modules, which
|
||||||
|
<productname>PostgreSQL</productname> does not have.
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The <literal>ON COMMIT</literal> clause for temporary tables
|
The <literal>ON COMMIT</literal> clause for temporary tables
|
||||||
also resembles SQL92, but has some differences.
|
also resembles SQL92, but has some differences.
|
||||||
@ -853,7 +860,7 @@ CREATE TABLE distributors (
|
|||||||
default behavior is <literal>ON COMMIT DELETE ROWS</>. However, the
|
default behavior is <literal>ON COMMIT DELETE ROWS</>. However, the
|
||||||
default behavior in <productname>PostgreSQL</productname> is
|
default behavior in <productname>PostgreSQL</productname> is
|
||||||
<literal>ON COMMIT PRESERVE ROWS</literal>. The <literal>ON COMMIT
|
<literal>ON COMMIT PRESERVE ROWS</literal>. The <literal>ON COMMIT
|
||||||
DROP</literal> option does not exist in SQL92 at all.
|
DROP</literal> option does not exist in SQL92.
|
||||||
</para>
|
</para>
|
||||||
</refsect2>
|
</refsect2>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user