↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / Array Functions And Operators

array_length

Read the PG 18 manual

Returns the length of the requested array dimension.

Reading PG 18current·documented in 19 of 27 versions, 8.4 to 20

Signatures & examples

array_length ( anyarray, integer ) → integer
Returns the length of the requested array dimension. (Produces NULL instead of 0 for empty or missing array dimensions.)
array_length(array[1,2,3], 1) → 3
array_length(array[]::int[], 1) → NULL
array_length(array['text'], 2) → NULL
Version history 2
  1. 12 → 13 changed
  2. 8.3 → 8.4 added

Definition snapshot: b7bd9cda · English manual source