Re: BUG #17340: Unnest discards rows with empty or null arrays

From: Magnus Falch <magnus(dot)falch(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17340: Unnest discards rows with empty or null arrays
Date: 2021-12-22 21:26:48
Message-ID: CAODrA7q=d7RvHRyt-vBr6AmJBAE-c8L7T=VqMBp9cChYUBJ0zg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I got an explanation from depesz that boils down to what Bruce explained.
Returning an unambiguous answer and discarding data is more explicit than
the other alternatives and is therefore the optimal compromise.

I submitted a doc patch suggestion for this.

Once documented and explained it's not an issue. And coalescing the target
array to an array containing the desired failover value is a good & easy
workaround to get what corresponds to what my gut feeling expected.

On Wed, Dec 22, 2021, 21:48 David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Wed, Dec 22, 2021 at 1:43 PM David G. Johnston <
> david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
>
>> On Mon, Dec 20, 2021 at 3:42 AM PG Bug reporting form <
>> noreply(at)postgresql(dot)org> wrote:
>>
>>> The following bug has been logged on the website:
>>>
>>> Bug reference: 17340
>>> Logged by: Magnus Falch
>>> Email address: magnus(dot)falch(at)gmail(dot)com
>>> PostgreSQL version: 14.1
>>> Operating system: Ubuntu 20.04
>>> Description:
>>>
>>> No part of the documentation covers this behaviour
>>
>>
>> Yes, this is under-documented.
>>
>>
> Specifically, it is documented here [1].
>
> [1]
> https://www.postgresql.org/docs/current/xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-SET
>
> David J.
>
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2021-12-22 21:38:27 Re: When Update balloons memory
Previous Message David G. Johnston 2021-12-22 20:48:12 Re: BUG #17340: Unnest discards rows with empty or null arrays