pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: mhwood@ameritech.net
To: pgsql-bugs@postgresql.org
Cc: mhwood@ameritech.net
Subject: BUG #14912: Undocumented: 'psql -l' assumes database 'postgresql' not $USER
Date: Thu, 16 Nov 2017 17:17:35 +0000
Message-ID: <20171116171735.1474.30450@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      14912
Logged by:          Mark Wood
Email address:      mhwood@ameritech.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.



view thread (6+ messages)  latest in thread

Message-ID: <20171116171735.1474.30450@wrigleys.postgresql.org>
Permalink:  ../20171116171735.1474.30450@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20171116171735.1474.30450@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: mhwood@ameritech.net
  Subject: Re: BUG #14912: Undocumented: 'psql -l' assumes database 'postgresql' not $USER
  In-Reply-To: <20171116171735.1474.30450@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox