Re: superuser() shortcuts - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: superuser() shortcuts
Date
Msg-id 20141124165000.GR28859@tamriel.snowman.net
Whole thread Raw
In response to Re: superuser() shortcuts  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
* Andres Freund (andres@2ndquadrant.com) wrote:
> On 2014-11-21 10:12:40 -0500, Stephen Frost wrote:
> > * Andres Freund (andres@2ndquadrant.com) wrote:
> > > I still think this change makes the error message more verbose, without
> > > any win in clarity.
> >
> > Can we agree that there should be consistency?
>
> Consistency with what? Are you thinking of the messages in
> aclck.c:no_priv_msg? I don't think that's really comparable. A
> permission denied on a relation is much easier to understand than
> replication permissions and such.

The discussion around wording started here, I believe:

20141022231834.GA1587@alvin.alvh.no-ip.org

Perhaps more to your question though, all checks of
'have_createdb_privilege' return 'permission denied to' style errors,
'have_createrole_privilege' returns 'permission denied' style for all
except where it returns the more specific 'must have admin option',
the 'has_rolcatupdate' check returns 'permission denied', and the
'has_bypassrls_privilege' check returns 'insufficient privilege' (note:
I'm in favor of changing that to use 'permission denied' instead too).

With regard to ereport() calls which return
ERRCODE_INSUFFICIENT_PRIVILEGE, things are pretty mixed up.  Some places
places say 'permission denied to' and then have 'must be superuser' as a
hint while others just say 'must be superuser' and then others are just
'permission denied' (such as aclchk.c:no_priv_msg).

> It'd surely not be better if pg_basebackup would a error message bar
> actually helpful information.

ENOPARSE.  I certainly agree that we want useful information to be
returned, in general..

> Btw, the replication permission use in
> postinit.c isn't related to slots.

Err, no, of course not, that should still be referring to starting
walsender.
Thanks!
    Stephen

pgsql-hackers by date:

Previous
From: David G Johnston
Date:
Subject: Re: Turning recovery.conf into GUCs
Next
From: Robert Haas
Date:
Subject: Re: test_shm_mq failing on anole (was: Sending out a request for more buildfarm animals?)