mirror of
https://github.com/postgres/postgres.git
synced 2025-12-12 02:37:31 +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:
@@ -42,7 +42,7 @@ SELECT * FROM truncate_a;
|
||||
|
||||
TRUNCATE truncate_a;
|
||||
ERROR: cannot truncate a table referenced in a foreign key constraint
|
||||
DETAIL: Table "truncate_b" references this one via foreign key constraint "$1".
|
||||
DETAIL: Table "truncate_b" references "truncate_a" via foreign key constraint "$1".
|
||||
SELECT * FROM truncate_a;
|
||||
col1
|
||||
------
|
||||
|
||||
Reference in New Issue
Block a user