There is a special function for this purpose - array_fill:
postgres=# select array_fill(0, ARRAY[10]);
array_fill
-----------------------
{0,0,0,0,0,0,0,0,0,0}
(1 row)
postgres=# select array_fill('Hello'::text, ARRAY[10]);
array_fill
---------------------------------------------------------------
{Hello,Hello,Hello,Hello,Hello,Hello,Hello,Hello,Hello,Hello}
(1 row)
postgres=# select array_fill(0, ARRAY[3,3]);
array_fill
---------------------------
{{0,0,0},{0,0,0},{0,0,0}}
(1 row)
In PL/pgSQL (but it is significantly slower for large arrays (over 100 items):
DO $$
DECLARE
result int[] = '{}';
BEGIN
FOR i IN 1..10
LOOP
result := result || 0;
END LOOP;
RAISE NOTICE '%', result;
END;
$$;
array_appendto add element in array if that's what you need - postgresql.org/docs/current/static/functions-array.html