Re: TRUNCATE question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TRUNCATE question
Date
Msg-id 16371.996807857@sss.pgh.pa.us
Whole thread Raw
In response to Re: TRUNCATE question  (Mike Mascari <mascarm@mascari.com>)
Responses Re: TRUNCATE question
List pgsql-hackers
Mike Mascari <mascarm@mascari.com> writes:
> Christopher Kings-Lynne wrote:
>> Is TRUNCATE supposed to be equivalent to DELETE FROM blah?
>> 
>> Because I notice that DELETE triggers are not called when you truncate a
>> table...  Isn't that a bad thing?

> It's supposed to work that way - same as Oracle. 

AFAICT, the whole point of TRUNCATE is to skip all the fancy stuff like
delete triggers and just zero the table.  Irreversibly.  If you don't
like it, don't use it...

Perhaps TRUNCATE should require superuser privilege, just to protect
people from themselves?  Not that the DBAs are necessarily any smarter
than anyone else, but at least they're supposed to know what they're
doing.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Schedule (was Re: [PATCHES] Patch for Improved Syntax Error Reporting)
Next
From: Tom Lane
Date:
Subject: Re: TRUNCATE question