Thread: Unnest discards rows with empty or null arrays

Unnest discards rows with empty or null arrays

From
PG Doc comments form
Date:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/14/functions-srf.html
Description:

https://www.postgresql.org/message-id/17340-74d17bbe94cb4190%40postgresql.org

This behaviour is unexpected from an external perspective but after speaking
with depesz I can see the exact edge case it's guarding against.
Returning rows with null values when the function does not return anything,
would be natural except for the fact that null is a valid return value by
itself.

Discarding the row is preferential to giving ambiguous answers since it's a
very clear answer.

I can't see it mentioned anywhere in the documentation though.