Re: Fix output of zero privileges in psql
От | David G. Johnston |
---|---|
Тема | Re: Fix output of zero privileges in psql |
Дата | |
Msg-id | CAKFQuwa+X4iKAG=DOrVCx3TzDLXoFs-3+oZQgSGEB1rSqXCRHw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Fix output of zero privileges in psql (Laurenz Albe <laurenz.albe@cybertec.at>) |
Ответы |
Re: Fix output of zero privileges in psql
|
Список | pgsql-hackers |
On Monday, October 23, 2023, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -6718,7 +6680,13 @@ static void
printACLColumn(PQExpBuffer buf, const char *colname)
{
appendPQExpBuffer(buf,
- "pg_catalog.array_to_string(%s, E'\\n') AS \"%s\"",
+ "CASE\n"
+ " WHEN %s IS NULL THEN ''\n"
+ " WHEN pg_catalog.cardinality(%s) = 0 THEN '%s'\n"
+ " ELSE pg_catalog.array_to_string(%s, E'\\n')\n"
+ "END AS \"%s\"",
+ colname,
+ colname, gettext_noop("(none)"),
colname, gettext_noop("Access privileges"));
}
This erroneously displays NULL as empty string and subverts my changes.
I have removed the first branch of the CASE expression.
There is no error here, the current consensus which this patch implements is to not change the documented “default privileges display as blank”. We are solving the empty privileges are not distinguishable complaint by printing (none) for them.
David J.
В списке pgsql-hackers по дате отправления: