Re: superuser() shortcuts

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, Adam Brightwell <adam(dot)brightwell(at)crunchydatasolutions(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: superuser() shortcuts
Date: 2014-12-02 19:35:31
Message-ID: 20141202193530.GT3342@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Robert Haas (robertmhaas(at)gmail(dot)com) wrote:
> On Tue, Dec 2, 2014 at 11:29 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > It includes the actual error message, unlike what we have today which is
> > guidence as to what's required to get past the permission denied error.
> >
> > In other words, I disagree that the same amount of information is being
> > conveyed.
>
> So, you think that someone might see the message "must be superuser or
> replication role to use replication slots" and fail to understand that
> they have a permissions problem?

I think that the error message about a permissions problem should be
that there is a permissions problem, first and foremost.

We don't say 'You must have SELECT rights on relation X to select from
it.' when you try to do a SELECT that you're not allowed to. We throw a
permissions denied error. As pointed out up-thread, we do similar
things for other cases of permissions denied and even beyond permission
denied errors we tend to match up the errmsg() with the errcode(), which
makes a great deal of sense to me and is why I'm advocating that
position.

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-12-02 19:41:49 Re: How about a option to disable autovacuum cancellation on lock conflict?
Previous Message Borodin Vladimir 2014-12-02 19:24:26 Re: Getting references for OID