Re: Psql meta-command conninfo+

Hunaid Sohail <hunaidpgml@gmail.com>

From: Hunaid Sohail <hunaidpgml@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@postgresql.org, Sami Imseih <samimseih@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>, Maiquel Grassi <grassi@hotmail.com.br>, Jim Jones <jim.jones@uni-muenster.de>, Tom Lane <tgl@sss.pgh.pa.us>, Nathan Bossart <nathandbossart@gmail.com>, "Imseih (AWS), Sami" <simseih@amazon.com>, Peter Eisentraut <peter@eisentraut.org>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Erik Wienhold <ewie@ewie.name>, Dean Rasheed <dean.a.rasheed@gmail.com>
Date: 2025-01-17T05:17:42Z
Lists: pgsql-hackers
Hi,

On Thu, Jan 16, 2025 at 6:01 PM Alvaro Herrera <alvherre@alvh.no-ip.org>
wrote:

> On 2025-Jan-16, Hunaid Sohail wrote:
>
> >  server_encoding               | UTF8
> >  server_version                | 18devel
> >  client_encoding               | UTF8
> >  session_authorization         | hunaid
> >  standard_conforming_strings   | on
> >  DateStyle                     | ISO, MDY
> >  scram_iterations              | 4096
> >  default_transaction_read_only | off
> >  application_name              | psql
> >  is_superuser                  | on
> >  search_path                   | "$user", public
> >  IntervalStyle                 | postgres
> >  TimeZone                      | Asia/Karachi
> >  integer_datetimes             | on
> >  in_hot_standby                | off
>
> Wait a second, why do we have these here?  Aren't they already in
> \dconfig?
>

There are indeed some overlaps because Sami [1] and David [2] suggested
to show all parameters, with Sami specifically asking to include
in_hot_standby
and application_name, as they can be useful. Moreover, parameters like
server_encoding and session_authorization were already included in previous
patches.

In other cases, we'd have to pick and choose which parameters to include.
If a new parameter is reported that might be relevant to this meta command
and
the user wants it included, we would need to modify the code repeatedly.

By the way, I just noticed CF bot failed with the error:
'undefined reference to palloc'.
Maybe I should use malloc as it is used in the file, and free with
PQmemfree().

[1]
https://www.postgresql.org/message-id/CAA5RZ0sa0%3DJP3RCs4_hZ%2BYVFCeU8b_aHSqiSFdUrf_ushcBTtw%40mail.gmail.com
[2]
https://www.postgresql.org/message-id/CAKFQuwb_R-zGT41xsBkPChBEB9e%3DA4P3fsAGjeqOzTuWN1Z5Sg%40mail.gmail.com

Regards,
Hunaid Sohail

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.