Hello
Proposal: http://archives.postgresql.org/pgsql-hackers/2008-06/msg00057.php
I changed name to array_fill and order of arguments.
postgres=# SELECT array_fill(0, ARRAY[2,3]);
array_fill
-------------------
{{0,0,0},{0,0,0}}
(1 row)
postgres=# SELECT array_fill(0, ARRAY[2,3], ARRAY[1,2]);
array_fill
------------------------------
[1:2][2:4]={{0,0,0},{0,0,0}}
(1 row)
postgres=# SELECT array_fill(0, ARRAY[4], ARRAY[2]);
array_fill
-----------------
[2:5]={0,0,0,0}
(1 row)
postgres=# SELECT array_fill(NULL::int, ARRAY[4]);
array_fill
-----------------------
{NULL,NULL,NULL,NULL}
(1 row)
Regards
Pavel Stehule