↑↓ select ↵ open ⌫ change scope Open full search

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

Functions / Array Functions And Operators

Returns an array filled with copies of the given value, having dimensions of the lengths specified by the second argument.

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

Signatures & examples

array_fill ( anyelement, integer[] [, integer[] ] ) → anyarray
Returns an array filled with copies of the given value, having dimensions of the lengths specified by the second argument. The optional third argument supplies lower-bound values for each dimension (which default to all 1).
array_fill(11, ARRAY[2,3]) → {{11,11,11},{11,11,11}}
array_fill(7, ARRAY[3], ARRAY[2]) → [2:4]={7,7,7}
Version history 3
  1. 12 → 13 changed
  2. 9.2 → 9.3 changed
  3. 8.3 → 8.4 added

Definition snapshot: b7bd9cda · English manual source