Re: Must be owner to truncate?

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Must be owner to truncate?
Date: 2005-08-24 12:44:29
Message-ID: 20050824124429.GL6026@ns.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Andreas Seltenreich (andreas+pg(at)gate450(dot)dyndns(dot)org) wrote:
> Bruce Momjian schrob:
> > Added to TODO:
> >
> > * Add TRUNCATE permission
> >
> > Currently only the owner can TRUNCATE a table because triggers are not
> > called, and the table is locked in exclusive mode.
>
> Is anyone working on this yet? I looked at the code involved, and it
> seems there are just a couple of lines needed, some regression test
> and documentation updates, and most importantly, tab-completion
> updates.

I'm not working on it, though I agree that it really shouldn't be very
difficult to add. I'd certainly like to see it done. While you're in
there I'd really like to see analyze and vacuum as grantable permissions
too...

Of course, eliminating the need for them would be even better... :)

> However, a question arose quickly: According to the standard, revoking
> INSERT, UPDATE and DELETE after GRANT ALL PRIVILEGES would leave the
> relation read-only, but with the TRUNCATE privilege lying around, this
> would no longer be true for PostgreSQL. Would this open a security
> hole or is it okay as far as extensions to the standard go?

Hrm, I'm not really sure about this one. I could see linking TRUNCATE
with DELETE (ie: you must have both DELETE and TRUNCATE permissions on a
table to TRUNCATE it, ala SELECT/UPDATE), or perhaps excluding TRUNCATE
from GRANT ALL PRIVILEGES.

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2005-08-24 12:48:36 Re: Must be owner to truncate?
Previous Message Manfred Koizar 2005-08-24 12:29:22 Re: Must be owner to truncate?