Re: variadic array arguments, can it work? - Mailing list pgsql-general

From Tom Lane
Subject Re: variadic array arguments, can it work?
Date
Msg-id 22276.1326989193@sss.pgh.pa.us
Whole thread Raw
In response to variadic array arguments, can it work?  (Ingmar Brouns <swingi@gmail.com>)
List 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 by date:

Previous
From: Ingmar Brouns
Date:
Subject: variadic array arguments, can it work?
Next
From: Scott Marlowe
Date:
Subject: Re: On duplicate ignore