From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: psql: Make SSL info display more compact
Date: Tue, 1 Mar 2022 09:44:29 +0100
Message-ID: <2b91fbb3-5b49-aec6-22ba-d1cb57185aa4@enterprisedb.com> (raw)
In-Reply-To: <2510882.1646061162@sss.pgh.pa.us>
References: <aee28ee7-0ab3-c2e2-5bed-109feb0c089b@enterprisedb.com>
<D0D58311-5C36-4B6C-9A09-8EC32A0D8A75@yesql.se>
<87sfs3e04m.fsf@wibble.ilmari.org>
<f59b3abc-3c42-c627-b7d6-dafd93ac68d9@enterprisedb.com>
<6E96453E-FD9E-4E04-A829-B7D5F6159279@yesql.se>
<2510882.1646061162@sss.pgh.pa.us>
On 28.02.22 16:12, Tom Lane wrote:
> Daniel Gustafsson <daniel@yesql.se> writes:
>> On 28 Feb 2022, at 12:56, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>>> On 28.02.22 11:50, Dagfinn Ilmari Mannsåker wrote:
>>>> How about making it show "compression: on" if compression is on, but
>>>> nothing in the common "off" case?
>
>>> That would work for me.
>
>> On POLA grounds I would prefer to never to show it. If we ever get libpq
>> compression and want to show that, I'd prefer that we didn't end up
>> "compression" meaning one thing except when it means two things.
>
> Well, any such output would presumably be on a different line and
> thus distinguishable from the SSL property; plus, it'd be impossible
> for both forms to show up in the same connection.
>
> However, how about writing "SSL compression: on" versus writing
> nothing? That avoids doubt about what it means. I don't buy
> Michael's argument that this is ambiguous, either.
I didn't mean to reopen the whole SSL compression can of worms here, I
was mistaken about the level of support left after PG14. I was merely
lightly annoyed that the psql startup display got quite long with not
very interesting information.
I propose a reduced patch that just removes the "bits" display, since
that is redundant with the "cipher" display.
Attachments:v2-0001-psql-Make-SSL-info-display-more-compact.patch (text/plain, 1.3K) download
From 9768dc5ab9a01a60e899bfc5c9e1a51475ded183 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Tue, 1 Mar 2022 09:38:38 +0100
Subject: [PATCH v2] psql: Make SSL info display more compact
Remove the bits display, since that can be derived from the cipher
suite.
---
src/bin/psql/command.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.cindex 292cff5df9..079f4a1a76 100644--- a/src/bin/psql/command.c+++ b/src/bin/psql/command.c@@ -3667,7 +3667,6 @@ printSSLInfo(void)
{
const char *protocol;
const char *cipher;
- const char *bits;
const char *compression;
if (!PQsslInUse(pset.db))
@@ -3675,13 +3674,11 @@ printSSLInfo(void)
protocol = PQsslAttribute(pset.db, "protocol");
cipher = PQsslAttribute(pset.db, "cipher");
- bits = PQsslAttribute(pset.db, "key_bits");
compression = PQsslAttribute(pset.db, "compression");
- printf(_("SSL connection (protocol: %s, cipher: %s, bits: %s, compression: %s)\n"),+ printf(_("SSL connection (protocol: %s, cipher: %s, compression: %s)\n"),
protocol ? protocol : _("unknown"),
cipher ? cipher : _("unknown"),
- bits ? bits : _("unknown"),
(compression && strcmp(compression, "off") != 0) ? _("on") : _("off"));
}
base-commit: a33e17f210547226ada52d2b8af851c3553bb4fa
--
2.35.1
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: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, tgl@sss.pgh.pa.us, daniel@yesql.se, ilmari@ilmari.org
Subject: Re: psql: Make SSL info display more compact
In-Reply-To: <2b91fbb3-5b49-aec6-22ba-d1cb57185aa4@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox