Re: Fix output of zero privileges in psql

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Erik Wienhold <ewie(at)ewie(dot)name>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Shubham Khanna <khannashubham1197(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix output of zero privileges in psql
Date: 2023-11-13 19:44:21
Message-ID: CAKFQuwbb=b74nNFGVrXhfo3cHgdssUBLer+hhnXWib=p_+GG2w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 13, 2023 at 12:36 PM Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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(dot)albe(at)cybertec(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2023-11-13 19:44:51 Re: COPY TO (FREEZE)?
Previous Message Laurenz Albe 2023-11-13 19:36:17 Re: Fix output of zero privileges in psql