Re: doc: Fix description of how the default user name is chosen

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: doc: Fix description of how the default user name is chosen
Date: 2022-07-06 00:43:19
Message-ID: CAKFQuwb01RN1YbVYfRXrzg4pfQLkx_Jkd=ExB9GvqtvXsfnxPw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 5, 2022 at 5:20 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > In passing, the authentication error examples use the phrase
> > "database user name" in a couple of locations. The word
> > database in both cases is both unusual and unnecessary for
> > understanding. The reference to user name means the one in/for the
> > database unless otherwise specified.
>
> I'm not convinced that just saying "user name" is an improvement.
> The thing that we are trying to clarify in much of this section
> is the relationship between your operating-system-assigned user
> name and your database-cluster-assigned user name. So just saying
> "user name" adds an undesirable element of ambiguity.

> Maybe we could change "database user name" to "Postgres user name"?
>

I'm fine with just leaving "database user name" as no one seems to have the
same qualm with it that I do. Besides, I just finished reading:

https://www.postgresql.org/docs/current/client-authentication.html

and it seems pointless to leave that written as-is and gripe about the
specific change I was recommending.

>
> - if you do not specify a database name, it defaults to the database
> - user name, which might or might not be the right thing.
> + if the database name shown matches the user name you are connecting
> + as it is not by accident: the default database name is the
> + user name.
>
> This does absolutely not seem like an improvement.
>

In that case I don't see the need for any form of commentary beyond:

"If you do not specify a database name it defaults to the database user
name."

> Since the database server uses the same default, you will not have
> to specify the port in most cases. The default user name is your
> - operating-system user name, as is the default database name.
> + operating-system user name. The default database name is the resolved
> user name.
>
> I agree this phrasing needs some work, but "resolved" doesn't seem
> helpful, since it's not defined here or nearby. Maybe "The default
> database name is the specified (or defaulted) user name." ?
>
>
"The default database name is the specified (or defaulted) database user
name."

I'll accept that "specified (or defaulted)" is simply another way to write
what I understand to be the common meaning of "resolved" in this situation.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-07-06 00:44:08 Re: should check interrupts in BuildRelationExtStatistics ?
Previous Message Andres Freund 2022-07-06 00:32:47 Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size