Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tXbo2-00AkQi-St for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2025 07:57:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tXbo1-00G4fg-GR for pgsql-hackers@arkaria.postgresql.org; Tue, 14 Jan 2025 07:57:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tXbo1-00G4fW-2p for pgsql-hackers@lists.postgresql.org; Tue, 14 Jan 2025 07:57:45 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tXbnz-000JtO-38 for pgsql-hackers@postgresql.org; Tue, 14 Jan 2025 07:57:44 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-542678284e3so642943e87.1 for ; Mon, 13 Jan 2025 23:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736841462; x=1737446262; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZXZKE3G/iOH4Rd4IWkBfuzOzL3OiFjA9h3W1UNLSJcc=; b=gC2wmurEmHrDnathIFMd0TQZeghCkqStPbddrwKHEJ74TwSVH1to038cmo1Q0YvIOV FwbcAbPyzaxdXS+/bgfGGVrz3yYSls6h66fgDLCnSiswERye/UYm9e8VBsM5yFYsYKz7 uL1x0qXz06wkG4jX070w50JUQAkyBIpozAuVoLELzhhG2qyl9hotCZM+jQil+EP9Lgk+ 9MyWzl6p0P+zqUEEMeTALuwKb+VtviqIz08HQyyfjc+DI8CTUv3GfmhVGPN3+qgbk3d8 MsBSFTX4lbBdqNuW/5iiTamnvlKakRVV8/ANY5kO+vsTDbrDTPDkA2fRhA9r/XK0+H6G alKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841462; x=1737446262; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZXZKE3G/iOH4Rd4IWkBfuzOzL3OiFjA9h3W1UNLSJcc=; b=dcwpDvA17ArGpiPzKqwQZ+rMBC1bgnYcKlnjLIFRS3dm9Bp2IlbojkDs/n4KKtBxxv 3//5eUxboI3N8jN8SsdfX98w3qm4akDPdL4GvvVXCCxJ/zg1LXFv6MuFe8IhpgbS0Ais VWoHaVe4Vt5h2jmzQ1ymR1ncSjAYv47r7GcIipkqMNZdBpOn6ONxsnO7oI5pcYQIVxad cCjA1OeJWqx10y3TTZEq5+k4c/0Ejg9gyq7Q7ibauA+q95wyzU7GNdKvvouCXzubckV7 W5LdXDBktxUFatBWTn1l+MdlqSRZ/ppfkjfclH95OC1swyEBaDFGWLB02Q+dsWMk32Rh VMiA== X-Forwarded-Encrypted: i=1; AJvYcCXS/utvR8XaQVxIfNIs8aEa17K3qmUby4z12Kkfw5KPwM9lcyFxqeB+F89URnCQFrT5+Y1vStyzlmVD8Lzr@postgresql.org X-Gm-Message-State: AOJu0Yy2SGkP/uazEqfvND8CGve7aQuzdkuVzhQNlbGSxhF7HuSIiWiJ odYTGvWEQG0+eBhSjvOkcUU9JDSq3yyFM1bAK4tZnS0CXE97xsb7RaTLs3gEJlclPfRgeNpbG2K grtMTasIA2sht3poUcVyycfpHMMc= X-Gm-Gg: ASbGncvFqACDXGGlEdIXU6ZsM0VVlaQvk+lE9TjYvG7ZE8FAxMAA+28jUBPY31AZ2pq 2upfMRnie6NnCNl9QpmLc5r5JTPDNncd1MshjPQ== X-Google-Smtp-Source: AGHT+IGzfywUB14UoFgmNwhaoO8jxfOiq0npiFboV6ErQqLDVUIF/J7MinDchin1l2ahkeh/Y6sLlZ0B8g/kign7Y5g= X-Received: by 2002:a05:6512:104a:b0:542:2990:6e9a with SMTP id 2adb3069b0e04-542845dd1c0mr2482129e87.12.1736841461582; Mon, 13 Jan 2025 23:57:41 -0800 (PST) MIME-Version: 1.0 References: <202501130844.yu2rovbwkl2u@alvherre.pgsql> In-Reply-To: From: Hunaid Sohail Date: Tue, 14 Jan 2025 12:57:29 +0500 X-Gm-Features: AbW1kvaGfVBV4ivcVz3AqKIWDFEeL_dOUMNB2xHOy3cWFcb-LIzBr0fwslbp5fU Message-ID: Subject: Re: Psql meta-command conninfo+ To: Dean Rasheed Cc: Alvaro Herrera , Sami Imseih , "David G. Johnston" , Maiquel Grassi , "pgsql-hackers@postgresql.org" , Jim Jones , Tom Lane , Nathan Bossart , "Imseih (AWS), Sami" , Peter Eisentraut , Pavel Luzanov , Erik Wienhold Content-Type: multipart/alternative; boundary="0000000000005952c6062ba5ead6" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005952c6062ba5ead6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Mon, Jan 13, 2025 at 4:12=E2=80=AFPM Dean Rasheed wrote: > I don't like the 3-table format either. I think it should be a single > table. > > The trouble with v35 is that it produces 1 row with lots of columns, > which is pretty unreadable unless expanded mode is used. So I think we > should just do it that way round by default -- i.e., make it like > \dconfig and have 2 columns, "Parameter" and "Value", with lots of > rows. > > Perhaps it could also have a "Description" column, which might help > with things like distinguishing between authenticated user and session > user. > I've tried the approach and attached the output. I'm not attaching the patch as it requires some formatting. Does this look good? I have added a one liner description that is consistent with libpq docs. postgres=3D# \conninfo+ Connection Information Parameter | Value | Description ----------------------+------------------------+---------------------------= ----------------------------------------------------- Database | postgres | Displays the database name of the connection. Client User | hunaid | Displays the name of the user connected to the database as returned by PQuser. Host | localhost | Displays the server host name of the active connection. Host Address | 127.0.0.1 | Displays the server IP address of the active connection. Port | 5430 | Displays the port number used for the database connection. Options | | Displays any command-line options passed in the connection request. Protocol Version | 3 | Displays the frontend/backend protocol being used. Password Used | false | Indicates whether a password was used during authentication. GSSAPI Authenticated | false | Indicates if GSSAPI authentication was used for the connection. Backend PID | 43465 | Displays the process ID of the backend for the connection. SSL Connection | true | Indicates whether SSL encryption is in use for the connection. SSL Protocol | TLSv1.3 | Displays the SSL protocol used for the connection. SSL Cipher | TLS_AES_256_GCM_SHA384 | Displays the SSL cipher used for the connection. SSL Compression | off | Indicates whether SSL compression is enabled. ALPN | postgresql | Displays the ALPN protocol used in the SSL connection. (15 rows) I was wondering how we can show the descriptions of parameters from PQparameterStatus. We can create an array of descriptions, but if the order changes somehow, it can mess things up. Looking forward to your opinions. Can we continue with this approach? Regards, Hunaid Sohail --0000000000005952c6062ba5ead6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Mon, Jan 13, 2025 at 4:12=E2= =80=AFPM Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
I don't like the 3-table format ei= ther. I think it should be a single table.

The trouble with v35 is that it produces 1 row with lots of columns,
which is pretty unreadable unless expanded mode is used. So I think we
should just do it that way round by default -- i.e., make it like
\dconfig and have 2 columns, "Parameter" and "Value", w= ith lots of
rows.

Perhaps it could also have a "Description" column, which might he= lp
with things like distinguishing between authenticated user and session
user.

I've tried the approach and a= ttached the output.
I'm not attaching the patch as it require= s some formatting. Does this look good?
I have added a one liner = description that is consistent with libpq docs.

po= stgres=3D# \conninfo+
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Connectio= n Information
=C2=A0 =C2=A0 =C2=A0 Parameter =C2=A0 =C2=A0 =C2=A0 | =C2= =A0 =C2=A0 =C2=A0 =C2=A0 Value =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Description
----------------------= +------------------------+-------------------------------------------------= -------------------------------
=C2=A0Database =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 | postgres =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 | Displays the database name of the connection.
=C2=A0Client User = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| hunaid =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 | Displays the name of the user connected to the d= atabase as returned by PQuser.
=C2=A0Host =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 | localhost =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| Displays the server host name of the active connection.
= =C2=A0Host Address =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 127.0.0.1 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| Displays the server IP address of the a= ctive connection.
=C2=A0Port =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 | 5430 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 | Displays the port number used for the database connection.
= =C2=A0Options =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| = Displays any command-line options passed in the connection request.
=C2= =A0Protocol Version =C2=A0 =C2=A0 | 3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| Displays the frontend/backend pr= otocol being used.
=C2=A0Password Used =C2=A0 =C2=A0 =C2=A0 =C2=A0| fals= e =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| Indicates= whether a password was used during authentication.
=C2=A0GSSAPI Authent= icated | false =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0| Indicates if GSSAPI authentication was used for the connection.
=C2= =A0Backend PID =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 43465 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| Displays the process ID of t= he backend for the connection.
=C2=A0SSL Connection =C2=A0 =C2=A0 =C2=A0= | true =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | In= dicates whether SSL encryption is in use for the connection.
=C2=A0SSL P= rotocol =C2=A0 =C2=A0 =C2=A0 =C2=A0 | TLSv1.3 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0| Displays the SSL protocol used for the connect= ion.
=C2=A0SSL Cipher =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | TLS_AES_256_G= CM_SHA384 | Displays the SSL cipher used for the connection.
=C2=A0SSL C= ompression =C2=A0 =C2=A0 =C2=A0| off =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| Indicates whether SSL compression is enabl= ed.
=C2=A0ALPN =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |= postgresql =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | Displays the ALPN p= rotocol used in the SSL connection.
(15 rows)

I= was wondering how we can show the descriptions of parameters
fro= m PQparameterStatus. We can create an array of descriptions,=C2=A0
but if the order changes somehow, it can mess things up.

Looking forward to your opinions. Can we continue with this approa= ch?

Regards,
Hunaid Sohail=C2=A0
--0000000000005952c6062ba5ead6--