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

From Stephen Frost
Subject Re: superuser() shortcuts
Date
Msg-id 20141204220602.GG25679@tamriel.snowman.net
Whole thread Raw
In response to Re: superuser() shortcuts  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: superuser() shortcuts  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: superuser() shortcuts  (Andres Freund <andres@2ndquadrant.com>)
List pgsql-hackers
* Andres Freund (andres@2ndquadrant.com) wrote:
> On 2014-12-04 15:59:17 -0500, Stephen Frost wrote:
> > I have a hard time wrapping my head around what a *lot* of our users ask
> > when they see a given error message, but if our error message is 'you
> > must have a pear-shaped object to run this command' then I imagine that
> > a new-to-PG user might think "well, I can't create pear shaped objects
> > in PG, so I guess this just isn't supported."  That's not necessairly
> > any fault of ours, but I do think "permission denied" reduces the chance
> > that there's any confusion about the situation.
>
> I've a hard time taking this comment seriously. If can't believe that
> you think that comment bears relation to the error message we're
> discussing.

It's reasonable to think that new users won't understand PG-specific
things such as role attributes.  A new user might not recognize or
understand what "replication role" is but they're more than likely to
get the gist behind "permission denied."

> > > The answer is that there really
> > > *isn't* any additional information conveyed by your proposal rewrite;
> >
> > To be sure it's clear, I *don't* agree with this.  You and I don't see
> > any additional information in it because we're familiar with the system
> > and know all about role attributes, the GRANT system, and everything
> > else.  I'm not looking to change the error message because it's going to
> > make it clearer to you or to me or to anyone else on this list though.
>
> > The "different style" is what's in the error style guidelines.
>
> I think you're vastly over-interpreting the guidelines because that
> happens to suite your position.

So I shouldn't consider what the guidelines have because they agree with
my position?  Perhaps we should *change* the guidelines if they aren't
what we should be following.

> None of the current error message violates any of:
>
> > The primary message should be short, factual, and avoid reference to
> > implementation details such as specific function names. "Short" means
> > "should fit on one line under normal conditions". Use a detail message
> > if needed to keep the primary message short, or if you feel a need to
> > mention implementation details such as the particular system call that
> > failed. Both primary and detail messages should be factual. Use a hint
> > message for suggestions about what to do to fix the problem, especially
> > if the suggestion might not always be applicable.

I agree that the text doesn't say "the error message should be related
to what the errcode used is", but it's certainly the implication of the
examples provided and, when the text doesn't make any reference, going
by what is in the example seems perfectly reasonable to me.

> And I don't for a second buy your argument that the permissions involved
> are an implemementation detail.

Would you agree with Peter that, rather than focus on if the errdetail()
involves an implementation detail or not, we should go ahead and add the
"You must have SELECT rights ..." to the existing cases where we just
say "permission denied"?

> If you say that you like the new message better because it's more
> consistent or more beautiful I can buy that. But don't try to find
> justifications in guidelines when they don't contain that.

I've said that I like the new messaging because it's more consistent
time and time again.  You suggest that I argue on that merit alone
rather than pointing out where we've (intentionally or not) used
examples which agree with me?  That strikes me as rather silly.

> > > I just don't understand why you want to pointlessly tinker with this.
> >
> > Because I don't feel it's pointless to improve the consistency of the
> > error messaging and I don't like that it's inconsistent today.
>
> Then please do so outside of patches/threads that do something pretty
> much unrelated.

Alright, I bothered to go back and find the relevant message- it's this
one: 20141022231834.GA1587@alvin.alvh.no-ip.org where Alvaro pointed out
that the messaging is inconsistent and asked that this patch should
include the correct wording (whatever we decide it to be) and further
commentary in 20141023232302.GH1791@alvin.alvh.no-ip.org matches that..
I didn't bring this up and I'm getting a bit put-out by the constant
implications that it's just all me and my crazy ideas for consistency.
Perhaps Alvaro doesn't care to argue the position further, which is
fine, but at least acknowledge that there are others who agree that
we're currently inconsistent (Alvaro and, I believe, Peter).
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: controlling psql's use of the pager a bit more
Next
From: Alvaro Herrera
Date:
Subject: Re: superuser() shortcuts