IS NULL

All functions > COMPARISON > IS NULL

Returns TRUE if the expression evaluates to NULL.

Syntax

expr IS NULL [:: type]

Notes

  • Only reliable way to test for NULL values
  • Using = NULL or != NULL always returns NULL, not TRUE/FALSE
  • Works with any data type; optional ::T after the keywords disambiguates the expression when its type would otherwise be unclear (for example EMPTY from an unmatched RELATED); when ::T is present it must match the expression type (including ARRAY and ROW)
  • Never returns NULL itself - always Returns TRUE or FALSE

Related Functions

Examples

IS NULL — detection

FeatureQL
SELECT
    f1 := NULL::BIGINT IS NULL::BIGINT, -- Typed NULL
    f2 := 1 IS NULL::BIGINT -- Non-NULL literal
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

IS NULL — composite values

FeatureQL
SELECT
    f1 := NULL::ARRAY(BIGINT) IS NULL::ARRAY(BIGINT), -- Typed NULL array
    f2 := ARRAY(1, 2) IS NULL::ARRAY(BIGINT) -- Non-NULL array
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

IS NULL — contrast with =

FeatureQL
SELECT
    f1 := NULL::BIGINT = NULL::BIGINT -- `=` cannot test NULL equality
;
Result
f1 BOOLEAN
NULL

Last update at: 2026/05/26 17:22:09