1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Disallow foreign-key references from temp tables to permanent tables.

Per recent discussion, this does not work because other backends can't
reliably see tuples in a temp table and so cannot run the RI checks
correctly.  Seems better to disallow this case than go back to accessing
temp tables through shared buffers.  Also, disallow FK references to
ON COMMIT DELETE ROWS tables.  We already caught this problem for normal
TRUNCATE, but the path used by ON COMMIT didn't check.
This commit is contained in:
Tom Lane
2003-09-19 21:04:20 +00:00
parent fc6b7c550d
commit a13b018530
5 changed files with 107 additions and 49 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/truncate.sgml,v 1.13 2003/09/12 00:12:47 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/truncate.sgml,v 1.14 2003/09/19 21:04:19 tgl Exp $
PostgreSQL documentation
-->
@ -50,6 +50,16 @@ TRUNCATE [ TABLE ] <replaceable class="PARAMETER">name</replaceable>
</variablelist>
</refsect1>
<refsect1>
<title>Notes</title>
<para>
<command>TRUNCATE</> cannot be used if there are foreign-key references
to the table from other tables. Checking validity in such cases would
require table scans, and the whole point is not to do one.
</para>
</refsect1>
<refsect1>
<title>Examples</title>