Multi-table truncate

Started by Alvaro Herreraover 21 years ago2 messagespatches
Jump to latest
#1Alvaro Herrera
alvherre@dcc.uchile.cl

Hackers,

This is my multi-table truncate patch. Includes doc changes and couple
new regression tests.

Note the following excerpt from the temp regression test:

+ BEGIN;
+ CREATE TEMP TABLE temptest3(col int PRIMARY KEY) ON COMMIT DELETE ROWS;
+ NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "temptest3_pkey" for table "temptest3"
+ CREATE TEMP TABLE temptest4(col int REFERENCES temptest3);
+ COMMIT;
+ ERROR:  invalid ON COMMIT and foreign key combination
+ DETAIL:  Table "temptest4" references "temptest3", but they don't have the same ON COMMIT setting

I haven't investigated whether we can reject the foreign-key/on-commit
combination at create table time, rather than commit time. Maybe it's
worth doing, but then apparently on-commit-actions is not used a lot
(nobody saw the bug I previously reported).

Please review and consider for application.

Thanks,

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Las mujeres son como hondas: mientras m�s resistencia tienen,
m�s lejos puedes llegar con ellas" (Jonas Nightingale, Leap of Faith)

Attachments:

truncate-2.patchtext/plain; charset=us-asciiDownload+540-495
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: Multi-table truncate

Alvaro Herrera <alvherre@dcc.uchile.cl> writes:

This is my multi-table truncate patch. Includes doc changes and couple
new regression tests.

Applied with minor editorialization.

regards, tom lane