RE: Psql meta-command conninfo+ - Mailing list pgsql-hackers

From Maiquel Grassi
Subject RE: Psql meta-command conninfo+
Date
Msg-id CP8P284MB2496093A2E465801D5B8134BEC4C2@CP8P284MB2496.BRAP284.PROD.OUTLOOK.COM
Whole thread Raw
In response to Re: Psql meta-command conninfo+  (Jim Jones <jim.jones@uni-muenster.de>)
List pgsql-hackers

Hi!

>7) -h 0.0.0.0 - As you mentioned, this is one of the cases where host
>and "server address" differ.
>   I am not sure if it is an issue. Perhaps the other reviewers might
>have an opinion on it

>$ /usr/local/postgres-dev/bin/psql -x -U postgres -h 0.0.0.0 -c
>"\conninfo+" -c "\conninfo"
>Current Connection Information
>-[ RECORD 1 ]------+-----------------------
>Database           | postgres
>Authenticated User | postgres
>System User        |
>Current User       | postgres
>Session User       | postgres
>Backend PID        | 404395
>Server Address     | 127.0.0.1
>Server Port        | 5432
>Client Address     | 127.0.0.1
>Client Port        | 54806
>Socket Directory   |
>Host               | 0.0.0.0
>Encryption         | SSL
>Protocol           | TLSv1.3
>Cipher             | TLS_AES_256_GCM_SHA384
>Compression        | off

I believe we don't actually have a problem here. To me, this makes sense.
I'm not a Networking expert, but from my standpoint, any string or IP
accepted by the "host" parameter of psql, pointing to "127.0.0.1" or to "::1", is correct.
I see it as a convention (would need to revisit Tanenbaum's books haha),
and I don't think there's a need to modify it. But as you mentioned, if someone
with more Networking knowledge could weigh in, a suggestion would be welcome.

>I'm not sure of the impact of this change in the existing \conninfo - at
>least the cfbot and "make -j check-world" didn't complain.
>I'll take a closer look at it as soon we have test cases.

This type of modification, in principle, does not generate errors as we
are only changing the display on screen of the strings already previously stored.

>To keep it consistent with the other options, we might wanna use "+ is
>appended" instead of "+ is specified" or "+ is given"

It seems to me that "appended" sounds good. I opted for it.
Following your suggestion, and merging this with the existing
previous ideas from the documentation, I've created a provisional
prototype of the column descriptions. At a later stage, I'll place the
descriptions correctly by removing placeholders (blah blah blah).
Along with this, I'll evaluate an iteration suggested by Nathan Bossart,

who also proposed changes.

Thank you for your work.

Regards,
Maiquel Grassi.

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Things I don't like about \du's "Attributes" column
Next
From: Tomas Vondra
Date:
Subject: Re: Add bump memory context type and use it for tuplesorts