On Tuesday, April 30, 2024, Darryl Dixon <
darryl.dixon@gmail.com> wrote:
Hi,
There are a couple of notes regarding this:
1) There is an explicit CAST of NULL->text that silently fails (see original example)
It doesn’t fail. Casting null still results in null. (Null::integer)::text is valid, you end up with a null integer converted to a null of type text.
2) This behaviour, if expected, is not well documented/contradicted by existing documentation. See the note here:
Fair, we don’t explicitly document that ‘…’ || NULL yields NULL. It’s more of “unless otherwise noted doing stuff with null results in unknown/null outcomes”.
David J.