Docs for psql regarding default database name are incorrect - Mailing list pgsql-bugs

From David G. Johnston
Subject Docs for psql regarding default database name are incorrect
Date
Msg-id CAKFQuwYEVVOaQokU9oi5VzfGfZcu0VEP5m6aAjP-U3OG4T_BnA@mail.gmail.com
Whole thread Raw
Responses Re: Docs for psql regarding default database name are incorrect  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
The documentation for psql saith:

The default user name is your operating-system user name, as is the default database name.

The default database name is the same as the user name chosen for the connection attempt.  Thus if one does "postgres~ psql -U davidj" the attempted database name will be davidj, not postgres even though the latter is the operating-system user name in effect.

The documentation for -U doesn't mention this changing of the attempted connect-to database.  It is not possible to specify a user name without a database name explicitly given for psql unless one uses -U.

Thus at minimum the above needs to read:

The default user name is your operating-system user name.  The default database name is the same as the resolved PostgreSQL user name.

Maybe change the description for -U:

"...of course)."  This also changes the default database name.

The parameter dbname in libpq got the memo:

The database name.  Defaults to be the same as the user name.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17437: time spent in JIT is also attributed to function scan
Next
From: Noah Misch
Date:
Subject: Re: Reconnect a single connection used by multiple threads in embedded SQL in C application causes error.