From: | Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> |
---|---|
To: | Hunaid Sohail <hunaidpgml(at)gmail(dot)com> |
Cc: | Maiquel Grassi <grassi(at)hotmail(dot)com(dot)br>, Sami Imseih <samimseih(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Erik Wienhold <ewie(at)ewie(dot)name>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
Subject: | Re: Psql meta-command conninfo+ |
Date: | 2025-02-21 18:19:10 |
Message-ID: | 202502211819.uevfb34wedav@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
I suggest the attached, which gets 99% there with 10% of the
complexity, and has \conninfo (no plus sign) output this:
Connection Information
Parámetro │ Valor
───────────────────────┼────────────────────────
Base de Datos │ alvherre
Client User │ alvherre
Host │ 192.168.178.37
Port │ 55432
Opciones │
Protocol Version │ 3
Password Used? │ false
GSSAPI Authenticated? │ false
Backend PID │ 1589499
TLS Connection? │ true
TLS Library │ OpenSSL
TLS Protocol │ TLSv1.3
TLS Key Bits │ 256
TLS Cipher │ TLS_AES_256_GCM_SHA384
TLS Compression │ false
ALPN │ postgresql
Superuser? │ on
Hot standby? │ off
(18 filas)
I have added the parameters is_superuser and in_hot_standby only, and
stayed away from the libpq part of the patch to enumerate parameters.
ISTM a hardcoded list is fine.
Maybe keeping track of 'role' via ParameterStatus messages is a good
idea for reasons unrelated to this patch -- maybe it can be useful for
applications to be aware of role changes -- but I'm not 100% sure about
that, and in particular I'm not sure how heavy the protocol traffic is
going to be if such messages are emitted every time you run a security
invoker function or things like that. So I'm leaving that part out for
now, and it's easy to do both the libpq patch and \conninfo.
Also, I don't see why we have to keep the current free-format \conninfo.
When you run a query, you get things like
# select 99 as "Luftballons";
Luftballons
─────────────
99
You don't get "There were only 99 Luftballons" or any such nonsense, and I
don't see why \conninfo gets to play different rules. So I got rid of
\conninfo+.
Do people hate the question marks?
--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
Attachment | Content-Type | Size |
---|---|---|
0001-Change-conninfo-to-use-tabular-format.patch | text/x-diff | 8.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Andrey Borodin | 2025-02-21 18:22:28 | Re: Amcheck verification of GiST and GIN |
Previous Message | Tomas Vondra | 2025-02-21 18:15:09 | Re: Amcheck verification of GiST and GIN |