Re: Repetition of warning message while REVOKE

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Piyush Newe <piyush(dot)newe(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org, Stephen Frost <sfrost(at)snowman(dot)net>
Subject: Re: Repetition of warning message while REVOKE
Date: 2010-03-04 16:32:28
Message-ID: 1267720348.27895.823.camel@jd-desktop.unknown.charter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2010-03-04 at 11:23 -0500, Tom Lane wrote:
> I wrote:
> > Piyush Newe <piyush(dot)newe(at)enterprisedb(dot)com> writes:
> >> create table tbl(col int);
> >> create user usr;
> >> grant select on tbl to usr;
> >> \c postgres usr;
> >> REVOKE SELECT on tbl from usr;
> >> WARNING: no privileges could be revoked for "tbl"
> >> WARNING: no privileges could be revoked for "tbl"
> >> WARNING: no privileges could be revoked for "tbl"
> >> WARNING: no privileges could be revoked for "tbl"
> >> WARNING: no privileges could be revoked for "tbl"
> >> WARNING: no privileges could be revoked for "tbl"
> >> WARNING: no privileges could be revoked for "tbl"
> >> WARNING: no privileges could be revoked for "tbl"
> >> REVOKE
>
> > You really should mention what version you're testing, but for the
> > archives: I confirm this on 8.4.x and HEAD. 8.3 seems to behave sanely.
>
> I traced through this and determined that the extra messages are a
> consequence of the column-level-privileges patch.
> restrict_and_check_grant is invoked both on the whole relation, and
> on each column (since we have to get rid of any per-column SELECT
> privilege that might have been granted).
>
> I'm not sure offhand about a reasonable way to rearrange the code to
> avoid duplicate messages.

Perhaps just add what can't be revoked? meaning:

WARNING: no privileges could be revoked for "tbl" for column "foo"

Then they aren't actually duplicate.

Sincerely,

Joshau D. Drake

>
> regards, tom lane
>

--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering
Respect is earned, not gained through arbitrary and repetitive use or Mr. or Sir.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2010-03-04 17:00:46 Re: Linux start script updates
Previous Message Tom Lane 2010-03-04 16:23:08 Re: Repetition of warning message while REVOKE