On Mon, Nov 13, 2023 at 12:36 PM Laurenz Albe <laurenz.a...@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.a...@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.ca...@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.

Reply via email to