Subject: Re: Psql meta-command conninfo+

From: Alvaro Herrera <[email-masked]>
Date: Mon, 20 Jan 2025 12:40:03 +0100

On 2025-Jan-17, Sami Imseih wrote:

> > Wait a second, why do we have these here?  Aren't they already in
> > \dconfig?
> 
>  \dconfig is generated by querying pg_settings and this
> requires a halthy connection. The parameters being proposed with
> \conninfo+ are set in libpq by the server [1] and can be retrieved
> even if the connection breaks.
> 
> Some of these parameters may overlap \dconfig, but I don't see
> that as a problem.

I feel the need to step back and ask, what problem are we solving here?
Your explanation isn't wrong, but I'm not sure why does a psql user need
all these.

I think you wanted to display "is_superuser" and that seems sensible in
the context of \conninfo+, and perhaps even "role" and "in_hot_standby"
would make sense; but the rest of the parameters that libpq stores do
not seem terribly interesting or relevant here.

That leads me to also wonder why don't we change \conninfo to have this
tabular behavior instead of creating a separate command for it.  Why do
we need to keep the existing form of \conninfo?  To me it seems strictly
less useful, as it is harder to read.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"Nunca se desea ardientemente lo que solo se desea por razón" (F. Alexandre)