function returning arrays?

Поиск
Список
Период
Сортировка
От stevew
Тема function returning arrays?
Дата
Msg-id 171315903.9662403.90@erica
обсуждение исходный текст
Список pgsql-sql
Hi there,

Can a function return an array?
I tried:
create function my_func() returns int4[] as
'select a_value from a_table where b_value = 1;'
language 'sql';

The parser don't like int4[]

What about a function returning an array of instances, is this possible?
create function my_func(a_value) returns my_table[] as
'select * from my_table where <a clause including the passed arg> ;'
language 'sql';

Though I guess this is probably best done with a view?

Any comments appreciated.

Steve W


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] Slashdot Query
Следующее
От: Vikrant Rathore
Дата:
Сообщение: Mail about duplicate rows