Re: Document NULL

Marcos Pegoraro <marcos@f10.com.br>

From: Marcos Pegoraro <marcos@f10.com.br>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, jian he <jian.universality@gmail.com>, Jeff Davis <pgsql@j-davis.com>, Yugo NAGATA <nagata@sraoss.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter@eisentraut.org>, David Rowley <dgrowleyml@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-13T14:39:42Z
Lists: pgsql-hackers
Em ter., 11 de nov. de 2025 às 12:34, Álvaro Herrera <alvherre@kurilemu.de>
escreveu:

> I have rebased this; here's v9.  I haven't reviewed it in depth, but
> intend to give it a read and get it pushed sometime in the
> not-too-distant future, so if anybody wants to review it some more, it'd
> be appreciated


Maybe this one
<programlisting>
SELECT
 1 + null AS "Add",
 'text' || null AS "Concatenate";
</programlisting>

Would be good to explain about explicit casting, because only Numeric, Text
and Boolean will work implicitly.

This ones will work
SELECT
 1 + null AS "Add",
 'text' || null AS "Concatenate",
 false or null AS "BoolOR";

But any other datatype will work only if casted properly
select Current_Date + null::integer;
select jsonb_build_object ('x',5) || null::jsonb

regards
Marcos