ARRAY_DIMS

Returns the dimensionality of the input array.

Returns the dimensionality of the input array.

Behavior type

Immutable

Syntax

ARRAY_DIMS(array)

Arguments

array
Target array

Supported data types

  • BOOLEAN

  • INTEGER

  • FLOAT

  • NUMERIC

  • STRING/VARCHAR

  • TIMESTAMP

  • TIMESTAMPTZ

  • DATE

  • UUID

  • INTERVAL

Examples

=> SELECT array_dims(ARRAY[[1,2],[2,3]]);
array_dims
------------
        2
(1 row)