Re: doc: Fix description of how the default user name is chosen - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: doc: Fix description of how the default user name is chosen
Date
Msg-id CAKFQuwaMs4PWcNckEVkWB3bjzG89HT5_xrtP-wEbX1tWLPq41w@mail.gmail.com
Whole thread Raw
In response to Re: doc: Fix description of how the default user name is chosen  (Bruce Momjian <bruce@momjian.us>)
Responses Re: doc: Fix description of how the default user name is chosen
List pgsql-hackers


On Sat, Jul 9, 2022, 08:16 Bruce Momjian <bruce@momjian.us> wrote:
On Sat, Jul  9, 2022 at 08:06:21AM -0700, David G. Johnston wrote:
> Maybe invoke the wording from the libpq docs and say:
>
> The default database name is the same as the user connection parameter.
>
> https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
>
> That page doesn’t feel the need to qualify user name and I don’t think it hurts
> comprehension; and the  writing “user parameter” there, instead of “user name”,
> since the parameter is simply “user”, not “username”.

Well, it could be the login OS name if the user connection parameter is
unspecified, right?


No.  It is always the user parameter.  It just so happens that parameter also has a default.  And so while there is a transitive aspect the resolution of the user parameter happens first, using the OS user if needed, then the dbname parameter is resolved using the user parameter if needed to supply the default.

David J.

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: doc: Fix description of how the default user name is chosen
Next
From: Tom Lane
Date:
Subject: Re: automatically generating node support functions