From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christoph Berg <myon@debian.org>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Improve default and empty privilege outputs in psql.
Date: Tue, 24 Sep 2024 13:57:28 -0400
Message-ID: <3463048.1727200648@sss.pgh.pa.us> (raw)
In-Reply-To: <3361177.1727195279@sss.pgh.pa.us>
References: <E1r2dkc-005J8F-Qc@gemulon.postgresql.org>
<ZvLXYglRS6hMMhtr@msg.df7cb.de>
<3361177.1727195279@sss.pgh.pa.us>
I wrote:
> Yes, that's the expectation. I'm sure we can think of a more
> backwards-compatible way to test for empty datacl, though.
Looks like the attached should be sufficient. As penance, I tried
all the commands in describe.c against 9.2 (or the oldest supported
server version), and none of them fail now.
regards, tom lane
Attachments:fix-ACL-printing-for-old-servers.patch (text/x-diff, 516B) downloaddiff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.cindex faabecbc76..6a36c91083 100644--- a/src/bin/psql/describe.c+++ b/src/bin/psql/describe.c@@ -6678,7 +6678,7 @@ printACLColumn(PQExpBuffer buf, const char *colname)
{
appendPQExpBuffer(buf,
"CASE"
- " WHEN pg_catalog.cardinality(%s) = 0 THEN '%s'"+ " WHEN pg_catalog.array_length(%s, 1) = 0 THEN '%s'"
" ELSE pg_catalog.array_to_string(%s, E'\\n')"
" END AS \"%s\"",
colname, gettext_noop("(none)"),
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, myon@debian.org, pgsql-hackers@lists.postgresql.org
Subject: Re: pgsql: Improve default and empty privilege outputs in psql.
In-Reply-To: <3463048.1727200648@sss.pgh.pa.us>
* 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