Re: Psql meta-command conninfo+

Hunaid Sohail <hunaidpgml@gmail.com>

From: Hunaid Sohail <hunaidpgml@gmail.com>
To: Jim Jones <jim.jones@uni-muenster.de>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Maiquel Grassi <grassi@hotmail.com.br>, Nathan Bossart <nathandbossart@gmail.com>, "Imseih (AWS), Sami" <simseih@amazon.com>, Peter Eisentraut <peter@eisentraut.org>, Tom Lane <tgl@sss.pgh.pa.us>, Pavel Luzanov <p.luzanov@postgrespro.ru>, Erik Wienhold <ewie@ewie.name>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-09-13T04:49:55Z
Lists: pgsql-hackers

Attachments

Hi,

On Thu, Sep 12, 2024 at 4:08 PM Jim Jones <jim.jones@uni-muenster.de> wrote:

> It may look like this, but it is a single record --- mind the header "-[
> RECORD 1 ]----------------+---------".
> psql was called in expanded mode:
>
> > $ /home/pgsql-17devel/bin/psql -x -p 5432
>
> "-x" or "--expanded"
>
> Example:
>
> $ psql postgres -xc "SELECT 'foo' col1, 'bar' col2"
> -[ RECORD 1 ]
> col1 | foo
> col2 | bar
>

I guess I missed the expanded mode. I have attached a new patch. Please
check the output now.

```
$ bin/psql --port=5430 postgres
psql (18devel)
Type "help" for help.

postgres=# \conninfo+
You are connected to database "postgres" as user "hunaid" via socket in
"/tmp" at port "5430".
                                                  Connection Information
 Protocol Version | SSL Connection | GSSAPI Authenticated | Client Encoding
| Server Encoding | Session User | Backend P
ID
------------------+----------------+----------------------+-----------------+-----------------+--------------+----------
---
 3                | no             | no                   | UTF8
 | UTF8            | hunaid       | 55598
(1 row)

postgres=# \x
Expanded display is on.
postgres=# \conninfo+
You are connected to database "postgres" as user "hunaid" via socket in
"/tmp" at port "5430".
Connection Information
-[ RECORD 1 ]--------+-------
Protocol Version     | 3
SSL Connection       | no
GSSAPI Authenticated | no
Client Encoding      | UTF8
Server Encoding      | UTF8
Session User         | hunaid
Backend PID          | 55598
```

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.