Re: TRUNCATE question - Mailing list pgsql-hackers

From Tom Lane
Subject Re: TRUNCATE question
Date
Msg-id 16591.996808348@sss.pgh.pa.us
Whole thread Raw
In response to Re: TRUNCATE question  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I wrote:
> Perhaps TRUNCATE should require superuser privilege, just to protect
> people from themselves?

Alternative possibilities came to mind just after I hit "send" ...

1. Refuse TRUNCATE if the table has any DELETE triggers.  (Are there
any other conditions to check for?)

2. If the table has DELETE triggers, allow TRUNCATE only to the
superuser.

Our current behavior is to allow TRUNCATE only to the table owner,
which seems to miss the point from a purely semantic point of view.
Anyone with DELETE privileges can do a universal DELETE, so why
shouldn't the faster alternative be available to them?

Does Oracle have any special permission checks for TRUNCATE?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: TRUNCATE question
Next
From: Oleg Bartunov
Date:
Subject: Re: patch for contrib/intarray (current CVS)