ARRAY FILL Function

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PostgreSQL ARRAY_FILL() function

ARRAY_FILL() function

This function is used to return an array initialized with supplied value and dimensions, optionally with lower bounds other than 1.

Syntax :

array_fill(anyelement, int[], [, int[]])

Return Type :

anyarray

PostgreSQL Version : 9.3

Example : PostgreSQL ARRAY_FILL() function

SELECT array_fill(7, ARRAY[3], ARRAY[2]);

Output :

  array_fill
---------------
 [2:4]={7,7,7}
(1 row)