Re: Table Valued Parameters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Table Valued Parameters
Дата
Msg-id 9984.1256399208@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Table Valued Parameters  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
Richard Huxton <dev@archonet.com> writes:
> To prevent quoting insanity, I recommend the ARRAY[] constructor rather
> than array literals. You do need the explicit typecasts.

By the same token, you might want to use ROW() rather than
composite-type literal syntax for the array elements.

> Oh - and version 8.3 or higher for arrays of compound types.

I think also that casting the array, rather than the individual rows,
only works as of 8.4; ie in 8.3 you have to follow the first example:

> SELECT print_array(ARRAY[ '(1,"abc")'::typ1, '(2,"def")'::typ1 ]);
> SELECT print_array(ARRAY[ '(1,"abc")', '(2,"def")' ]::typ1[]);

In this case there's not much real difference, but with a lot of
array elements the individual casts get tedious.
        regards, tom lane


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

Предыдущее
От: Brian Modra
Дата:
Сообщение: Re: Table Valued Parameters
Следующее
От: John
Дата:
Сообщение: trouble with getting the field names