Re: Psql meta-command conninfo+

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Maiquel Grassi <grassi@hotmail.com.br>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: "Imseih (AWS), Sami" <simseih@amazon.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Nathan Bossart <nathandbossart@gmail.com>, Jim Jones <jim.jones@uni-muenster.de>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Erik Wienhold <ewie@ewie.name>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-04-05T14:50:18Z
Lists: pgsql-hackers
On 04.04.24 18:15, Maiquel Grassi wrote:
> Well, I can revert \conninfo to its original state and keep \conninfo+
> as it is, perhaps removing the application name, as I believe everything
> else is important for a DBA/SysAdmin. Do you think we can proceed
> with the patch this way? I am open to ideas that make \conninfo not
> limited to just four or five basic pieces of information and easily bring
> everything else to the screen.

The original \conninfo was designed to report values from the libpq API 
about what libpq connected to.  And the convention in psql is that "+" 
provide more or less the same information but a bit more.  So I think it 
is wrong to make "\conninfo+" something fundamentally different than 
"\conninfo".

And even more so if it contains information that isn't really 
"connection information".  For example, current_user() doesn't make 
sense here, I think.

I mean, if you want to add a command \some_useful_status_information, we 
can talk about that, but let's leave \conninfo to what it does.

But I think there are better ways to implement this kind of server-side 
status, for example, with a system view.

One problem in this patch is that it has no tests.  Any change in any of 
the involved functions or views will silently break this.  (Note that 
plain \conninfo doesn't have this problem to this extent because it only 
relies on libpq function calls.  Also, a system view would not have this 
problem.)




Commits

  1. psql: Change new \conninfo to use SSL instead of TLS

  2. Change \conninfo to use tabular format

  3. Update extension lookup routines to use the syscache

  4. Improve COPY TO performance when server and client encodings match

  5. doc: Remove superfluous bracket in synopsis

  6. Remove psql support for server versions preceding 9.2.