public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alvaro Herrera <[email protected]>
To: Sami Imseih <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Maiquel Grassi <[email protected]>
Cc: Hunaid Sohail <[email protected]>
Cc: [email protected] <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: Jim Jones <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Imseih (AWS), Sami <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Cc: Pavel Luzanov <[email protected]>
Cc: Erik Wienhold <[email protected]>
Cc: Dean Rasheed <[email protected]>
Subject: Re: Psql meta-command conninfo+
Date: Sat, 22 Feb 2025 10:16:48 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAA5RZ0vmKYcGbZqtxMcPTFrNPGm1-9_9U3nnYSM7aG+Oin5gjw@mail.gmail.com>

On 2025-Feb-21, Sami Imseih wrote:

> > If we want to include 'role' in this output, what I'd propose is to
> > have \conninfo issue "SHOW role", which is accepted by every server
> > version.  If it fails (say because we're in an aborted transaction),
> > just omit that row from the output.
> 
> v37- would have handled this as the list of PQ parameters was
> dynamically generated and only those parameters
> reported by the specific version of the server showed up in
> \conninfo+.

Okay, I have pushed this with some trivial tweaks -- removed the
question marks and capitalized a couple of words.  I also changed "Port"
to "Server Port" because I wasn't sure it was obvious it was that, and
maybe we want to list the client port as well (like pg_stat_activity
does).

We can continue to discuss adding 'role', 'server authorization' and so
on, if people think they are going to be useful.  We can consider such a
decision an open item for 18.

I tried it with 9.2, which doesn't have in_hot_standby.  It shows like
this

55441 18devel 356833=# \conninfo
            Connection Information
      Parameter       │         Value          
──────────────────────┼────────────────────────
 Database             │ alvherre
 Client User          │ alvherre
 Host                 │ localhost
 Host Address         │ ::1
 Server Port          │ 55441
 Options              │ 
 Protocol Version     │ 3
 Password Used        │ false
 GSSAPI Authenticated │ false
 Backend PID          │ 356833
 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                 │ none
 Superuser            │ on
 Hot Standby          │ unknown
(19 rows)

I think "unknown" here is okay, though we could probably say
"unsupported by server" or just set it to null.

Note that the boolean for superuser says 'on' instead of 'true'.  Maybe
we should make all the booleans use on/off instead of true/false?  Not
sure.

Now we need someone to implement the PQsslAttribute() equivalent for
GSS!  If only to prove that the effort of tweaking the TLS layer to
support multiple libraries ...

Also, there's a bunch of "(char *)" casts that are 100% due to
printTableAddCell() taking a char * instead of const char * for the cell
value.  That seems a bit silly, we should change that.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/






view thread (4+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Psql meta-command conninfo+
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox