Re: variadic array arguments, can it work?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: variadic array arguments, can it work?
Дата
Msg-id 22276.1326989193@sss.pgh.pa.us
обсуждение исходный текст
Ответ на variadic array arguments, can it work?  (Ingmar Brouns <swingi@gmail.com>)
Список pgsql-general
Ingmar Brouns <swingi@gmail.com> writes:
> I was trying to write a variadic function where the arguments themselves
> are arrays, but calling it does not seem to work. I couldn't find
> documentation mentioning this restriction

> postgres=# create or replace function foo(variadic args integer[][])

The reason that doesn't work the way you're expecting is that
1-dimensional integer arrays are not a distinct datatype from
2-dimensional integer arrays.  The system just sees "variadic int[]"
and expects simple integers in a variadic expansion.  Sorry.

            regards, tom lane

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

Предыдущее
От: Ingmar Brouns
Дата:
Сообщение: variadic array arguments, can it work?
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: On duplicate ignore