Re: Must be owner to truncate? - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Must be owner to truncate?
Date
Msg-id 20050824124836.GM6026@ns.snowman.net
Whole thread Raw
In response to Re: Must be owner to truncate?  (Manfred Koizar <mkoi-pg@aon.at>)
List pgsql-hackers
* Manfred Koizar (mkoi-pg@aon.at) wrote:
> On Wed, 24 Aug 2005 07:01:00 +0200, Andreas Seltenreich
> <andreas+pg@gate450.dyndns.org> wrote:
> >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.
>
> I'd say that the TRUNCATE privilege includes DELETE, so that REVOKE
> DELETE implicitly revokes TRUNCATE and GRANT TRUNCATE implicitly
> grants DELETE.

I disagree with implicitly granting/revokeing.  Rather, if we're going
to go this route, we should require both DELETE and TRUNCATE rights on
the object in order to TRUNCATE it but otherwise have TRUNCATE
privileges and DELETE privileges be distinct from each other in terms of
being granted/revoked.

This follows the SELECT/UPDATE relationship.  Granting UPDATE doesn't
implicitly grant SELECT, and revoking SELECT doesn't implicitly revoke
UPDATE; but in order to actually UPDATE you need SELECT rights.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Must be owner to truncate?
Next
From: Bruce Momjian
Date:
Subject: Re: ECPG and escape strings