Re: Triggers on TRUNCATE?

From: Daniel Baldoni <pgsql(at)lcds(dot)com(dot)au>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Triggers on TRUNCATE?
Date: 2004-07-27 03:27:06
Message-ID: 4105CB8A.4A030C76@lcds.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

G'day folks,

Tom Lane wrote:
> Daniel Baldoni <pgsql(at)lcds(dot)com(dot)au> writes:
>> Forgive this if it's totally "out there" but I was wondering why
>> there's no support for triggers on a TRUNCATE operation.
>
> Because the entire point of TRUNCATE is not to scan the table contents.
>
> If you want to fire triggers, just use "DELETE FROM foo".

Personally, I've never used TRUNCATE within a production system (I can't
even recall using an unqualified DELETE).

How do you then audit a TRUNCATE performed by somebody else (who, for
"political" reasons, has superuser access)? Such actions aren't limited to
attacks - but may simply be the result of "I thought it was a good idea at
the time". :-(

Ciao.

--
-------------------------------------------------------+---------------------
Daniel Baldoni BAppSc, PGradDipCompSci | Technical Director
require 'std/disclaimer.pl' | LcdS Pty. Ltd.
-------------------------------------------------------+ 856B Canning Hwy
Phone/FAX: +61-8-9364-8171 | Applecross
Mobile: 041-888-9794 | WA 6153
URL: http://www.lcds.com.au/ | Australia
-------------------------------------------------------+---------------------
"Any time there's something so ridiculous that no rational systems programmer
would even consider trying it, they send for me."; paraphrased from "King Of
The Murgos" by David Eddings. (I'm not good, just crazy)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-07-27 03:42:51 Re: cvsweb upgraded
Previous Message Tom Lane 2004-07-27 02:50:05 Re: Triggers on TRUNCATE?