DISPLAYS AS

All functions > COMPARISON > DISPLAYS AS

Returns TRUE if two values are not distinct, treating NULL values as comparable.

Syntax

expr1 DISPLAYS AS expr2  ·  expr1 IS NOT DISTINCT FROM expr2

Notes

  • Unlike =, NULL is treated as comparable here
  • NULL DISPLAYS AS NULL is TRUE (they are the same)
  • value DISPLAYS AS NULL is FALSE when value is not NULL
  • NULL DISPLAYS AS value is FALSE when value is not NULL
  • Both values must be of the same type (including matching ARRAY/ROW structure and field/element types)
  • Opposite of NOT DISPLAYS AS
  • SQL spelling IS NOT DISTINCT FROM is a separate operator/function pair (same semantics, preserves formatting)

Related Functions

See also

Examples

DISPLAYS AS

FeatureQL
SELECT
    -- Same values
    f1 := 1 DISPLAYS AS 1,
    -- Different values
    f2 := 1 DISPLAYS AS 2
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

NULL handling

FeatureQL
SELECT
    -- Both NULL
    f1 := NULL::BIGINT DISPLAYS AS NULL::BIGINT,
    -- NULL vs non-NULL
    f2 := NULL::BIGINT DISPLAYS AS 1,
    -- Non-NULL vs NULL
    f3 := 1 DISPLAYS AS NULL::BIGINT
;
Result
f1 BOOLEANf2 BOOLEANf3 BOOLEAN
truefalsefalse

Other types

FeatureQL
SELECT
    -- Same doubles
    f1 := 1e0 DISPLAYS AS 1e0,
    -- Both NULL doubles
    f2 := NULL::DOUBLE DISPLAYS AS NULL::DOUBLE
;
Result
f1 BOOLEANf2 BOOLEAN
truetrue

DISPLAYS AS — arrays and rows

FeatureQL
SELECT
    -- Equal rows
    f1 := ROW(1 AS a) DISPLAYS AS ROW(1 AS a),
    -- Both NULL arrays
    f2 := NULL::ARRAY(BIGINT) DISPLAYS AS NULL::ARRAY(BIGINT)
;
Result
f1 BOOLEANf2 BOOLEAN
truetrue

Last update at: 2026/06/20 10:08:10