Re: TRUNCATE - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: TRUNCATE
Date
Msg-id GNELIHDDFBOCMGBFGEFOGEJECCAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: TRUNCATE  ("Joel Burton" <joel@joelburton.com>)
Responses Re: TRUNCATE  ("Joel Burton" <joel@joelburton.com>)
Re: TRUNCATE  (nconway@klamath.dyndns.org (Neil Conway))
List pgsql-hackers
> I'm happy w/o the FORCE option (just let TRUNCATE do it), but if enough
> people think that the FORCE keyword should be added to allow overriding of
> triggers, that could be a good compromise.
>
> But, please, don't take away the ability to TRUNCATE. Doing it when there
> are triggers is one the strengths of TRUNCATE, IMNSHO.

It seems to me that there's more and more need for an 'SET CONSTRAINTS
DISABLED' and 'SET CONSTRAINTS ENABLED' command that affects only foreign
keys.  This would basically make it ignore foreign key checks for the
remainder of the transaction.  This could be used before a TRUNCATE command,
and would also be essential when we switch to dumping ALTER TABLE/FOREIGN
KEY commands in pg_dump, and we don't want them to be checked...

Chris



pgsql-hackers by date:

Previous
From: "Rod Taylor"
Date:
Subject: Re: Operator Comments
Next
From: "Joel Burton"
Date:
Subject: Re: TRUNCATE