Re: TRUNCATE question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Mascari <mascarm(at)mascari(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TRUNCATE question
Date: 2001-08-03 03:04:17
Message-ID: 16371.996807857@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mike Mascari <mascarm(at)mascari(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-08-03 03:12:28 Re: TRUNCATE question
Previous Message Tom Lane 2001-08-03 02:55:50 Schedule (was Re: [PATCHES] Patch for Improved Syntax Error Reporting)