Re: Fix output of zero privileges in psql - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Fix output of zero privileges in psql
Date
Msg-id CAKFQuwbb=b74nNFGVrXhfo3cHgdssUBLer+hhnXWib=p_+GG2w@mail.gmail.com
Whole thread Raw
In response to Re: Fix output of zero privileges in psql  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: Fix output of zero privileges in psql
List pgsql-hackers
On Mon, Nov 13, 2023 at 12:36 PM Laurenz Albe <laurenz.albe@cybertec.at> wrote:
On Mon, 2023-11-13 at 11:27 +0100, Erik Wienhold wrote:
> On 2023-11-09 20:19 +0100, Tom Lane wrote:
> > Laurenz Albe <laurenz.albe@cybertec.at> writes:
> > > Thanks for the feedback.  I'll set the patch to "ready for committer" then.
> >
> > So, just to clarify, we're settling on your v4 from [1]?
> >
> > [1] https://www.postgresql.org/message-id/d799f996f422231a99655f1223667d6d887e4c95.camel@cybertec.at
>
> Yes from my side.

+1


+0.5 for the reasons already stated; but I get and accept the argument for NULL.

I will reiterate my preference for writing an explicit IS NULL branch in the case expression instead of relying upon the strict-ness of array_to_string.

+  "CASE\n"
  WHEN %s IS NULL THEN NULL
+  "  WHEN pg_catalog.cardinality(%s) = 0 THEN '%s'\n"
+  "  ELSE pg_catalog.array_to_string(%s, E'\\n')\n"
+  "END AS \"%s\"",

David J.


pgsql-hackers by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Fix output of zero privileges in psql
Next
From: Bruce Momjian
Date:
Subject: Re: COPY TO (FREEZE)?