Proposal: new function array_init

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Proposal: new function array_init
Дата
Msg-id 162867790806020903y32a90ec3s5635025c36f590a3@mail.gmail.com
обсуждение исходный текст
Ответы Re: Proposal: new function array_init
Список pgsql-hackers
Hello

There was more time questions about array's initialisation. I propose
function array_init.

CREATE OR REPLACE FUNCTION array_init(sizes int[], v anyelement)
RETURNS anyarray;

First parameter is array of dimension's sizes. Second argument is
value that will be used for initialisation.

Because pg array's indexes must not start from 1 we can allow specify it.

CREATE OR REPLACE FUNCTION array_init(sizes int[], lowers int[], v
anyelement) RETURNS anyarray;



select array_init(array[2],0);    array
---------------    {0,0}
(1 row)


select array_init(array[1,2], 0);    array
---------------{{0,0},{0,0}}
(1 row)

Any comments?

Regards
Pavel Stehule


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Jignesh K. Shah"
Дата:
Сообщение: Re: Overhauling GUCS
Следующее
От: "David E. Wheeler"
Дата:
Сообщение: Re: Case-Insensitve Text Comparison