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
| Parameter | Type | Required | Description |
|---|---|---|---|
expr | T | Yes | Expression that may be NULL |
Notes
- Only reliable way to test for NULL values
- Using
= NULLor!= NULLalways returns NULL, not TRUE/FALSE - Works with any data type (scalars, ARRAY, ROW, etc.); optional
::typeafter 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 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
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 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |