Dominique Devienne <ddevienne@gmail.com> writes:
> AFAIK, it’s not psql that does this though, it’s libpq the official client
> api.
> And the fact libpq has no way to surface that info seems like an important
> oversight.
PQconninfo() will show you all the option values in use by a connection
object. It's true that it's not very easy to tell where any given value
came from, but I doubt it'd be worth an ABI break to add such info.
(You could at least recognize values that match the hard-wired default
or environment variable value.)
regards, tom lane