IS_NULL()

All functions > COMPARISON > IS_NULL()

Returns TRUE if the expression evaluates to NULL.

Signatures

Returns: TRUE or FALSE; these predicates do not return NULL themselves

IS_NULL(expr: T) → BOOLEAN
sql
ParameterTypeRequiredDescription
exprTYesExpression that may be NULL

Notes

  • Only reliable way to test for NULL values
  • Using = NULL or != NULL always returns NULL, not TRUE/FALSE
  • Works with any data type (scalars, ARRAY, ROW, etc.); optional ::type after the keyword must match the expression type when present
  • Never returns NULL itself - always Returns TRUE or FALSE

Related operators

Examples

IS_NULL — functional call (second arg is TYPE '…', not a bare type name)

FeatureQL
SELECT
    f1 := IS_NULL(NULL::BIGINT, TYPE 'BIGINT'), -- `TYPE 'T'` supplies the predicate type; it must match the expression type
    f2 := IS_NULL(1::BIGINT, TYPE 'BIGINT') -- Non-NULL value
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

IS_NULL — chained

FeatureQL
SELECT
    f1 := (NULL::BIGINT).IS_NULL(TYPE 'BIGINT'), -- Dot form: receiver is the expression under test
    f2 := (1::BIGINT).IS_NULL(TYPE 'BIGINT') -- Same semantics as the prefix call
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

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