Skip to content

Commit 1591b38

Browse files
committed
Fix psql describe commands' handling of ACL columns for old servers.
Commit d1379eb carelessly broke printACLColumn for pre-9.4 servers, by using the cardinality() function which we introduced in 9.4. We expect psql's describe-related commands to work back to 9.2, so this is bad. Use the longstanding array_length() function instead. Per report from Christoph Berg. Back-patch to v17. Discussion: https://postgr.es/m/ZvLXYglRS6hMMhtr@msg.df7cb.de
1 parent ceeaaed commit 1591b38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bin/psql/describe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6678,7 +6678,7 @@ printACLColumn(PQExpBuffer buf, const char *colname)
66786678
{
66796679
appendPQExpBuffer(buf,
66806680
"CASE"
6681-
" WHEN pg_catalog.cardinality(%s) = 0 THEN '%s'"
6681+
" WHEN pg_catalog.array_length(%s, 1) = 0 THEN '%s'"
66826682
" ELSE pg_catalog.array_to_string(%s, E'\\n')"
66836683
" END AS \"%s\"",
66846684
colname, gettext_noop("(none)"),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy