Re: TRUNCATE question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Mascari <mascarm(at)mascari(dot)com>, 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:12:28
Message-ID: 16591.996808348@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2001-08-03 04:01:59 Re: patch for contrib/intarray (current CVS)
Previous Message Tom Lane 2001-08-03 03:04:17 Re: TRUNCATE question