BUG #14912: Undocumented: 'psql -l' assumes database 'postgresql' not $USER

From: mhwood(at)ameritech(dot)net
To: pgsql-bugs(at)postgresql(dot)org
Cc: mhwood(at)ameritech(dot)net
Subject: BUG #14912: Undocumented: 'psql -l' assumes database 'postgresql' not $USER
Date: 2017-11-16 17:17:35
Message-ID: 20171116171735.1474.30450@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 14912
Logged by: Mark Wood
Email address: mhwood(at)ameritech(dot)net
PostgreSQL version: 9.6.6
Operating system: Gentoo Linux, kernel 4.12, glibc 2.25-r9
Description:

The 'psql' man page explains that the default database name is your OS
username, and that $PGDATABASE can be used to supply a different default.
That is true *unless* using -l / --list. The code shows that this option
defaults to 'postgresql' instead, overriding the libpq defaulting. I spent
quite some time reading and experimenting to determine why I was not seeing
the documented behavior.

The actual behavior may be reasonable, but if so it should be documented as
an exception for the --list function.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2017-11-16 21:27:06 Re: BUG #14912: Undocumented: 'psql -l' assumes database 'postgresql' not $USER
Previous Message dhimitra.pappa 2017-11-16 13:28:53 BUG #14911: pg_log not create during upgrade