Re: Psql meta-command conninfo+

From: Hunaid Sohail <hunaidpgml(at)gmail(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Erik Wienhold <ewie(at)ewie(dot)name>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Psql meta-command conninfo+
Date: 2024-09-13 04:49:55
Message-ID: CAMWA6yZJVW9Wh+M4w3=dm62n_otOgQzPoxfoqhfTJ=_Ycnr_5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Sep 12, 2024 at 4:08 PM Jim Jones <jim(dot)jones(at)uni-muenster(dot)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

Attachment Content-Type Size
v33-0001-Add-psql-meta-command-conninfo.patch application/x-patch 7.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message torikoshia 2024-09-13 05:26:27 Re: Using per-transaction memory contexts for storing decoded tuples
Previous Message Bertrand Drouvot 2024-09-13 04:25:46 Re: per backend I/O statistics