Re: Raise a WARNING if a REVOKE affects nothing?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Raise a WARNING if a REVOKE affects nothing?
Date: 2012-10-04 13:48:31
Message-ID: CA+TgmoZ+79wnTCt56YBnbPw-=0FPF-CzgL=NjnQip0MtORp2NQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 2, 2012 at 3:01 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> On Tue, Aug 21, 2012 at 02:31:29PM +0800, Craig Ringer wrote:
>> It'd really help if REVOKE consistently raised warnings when it didn't
>> actually revoke anything.
>
> +1
>
> This will invite the same mixed feelings as the CREATE x IF NOT EXISTS
> notices, but I think it's worthwhile.

Just to ask a possibly stupid question: why is attempting to a REVOKE
a non-existent privilege anything other than an ERROR?

We would throw an ERROR if you tried to insert into a nonexistent
table, or if you tried to drop a nonexistent table, or if you tried to
call a nonexistent function, so why not also here?

We could have REVOKE IF EXISTS for the current behavior (and users
could boost client_min_messages to suppress the notice when deisred).

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2012-10-04 13:52:07 Re: Switching timeline over streaming replication
Previous Message Amit Kapila 2012-10-04 12:27:52 Re: BUG #7534: walreceiver takes long time to detect n/w breakdown