Re: Fwd: [Patch Review] TRUNCATE Permission

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: "Ryan Bradetich" <rbradetich(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: [Patch Review] TRUNCATE Permission
Date: 2008-09-08 00:54:51
Message-ID: 24940.1220835291@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Robert Haas" <robertmhaas(at)gmail(dot)com> writes:
> Updated patch attached, based on comments from Ryan Bradetich and Tom
> Lane, and sync'd to latest CVS version.

Applied with really pretty minor revisions --- this was a nice clean
patch. Changes I can recall making:

* You missed one or two documentation references to DELETE privilege.

* You modified the privileges test to create another userid, but forgot
to clean up afterwards.

* LOCK TABLE requires UPDATE or DELETE privilege for locks stronger
than AccessShareLock. I thought it would be inconsistent to not allow
TRUNCATE to satisfy this requirement too.

* Many of the information_schema views require some privilege on a table
to show details about the table. Again, it seemed inconsistent to not
allow TRUNCATE privilege to satisfy this requirement.

* A couple of the information_schema views show available privileges on
tables by name. It's a bit dubious whether we should show TRUNCATE in
them, since there is no such privilege bit in the SQL standard, but
after some reflection I concluded that functionality trumps a narrow
reading of the spec here. We can revisit that if anyone wants to argue
for the other way, though.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2008-09-08 01:36:40 Re: Fwd: [Patch Review] TRUNCATE Permission
Previous Message Robert Haas 2008-09-08 00:22:29 Re: [PATCH] allow has_table_privilege(..., 'usage') on sequences