Re: Function returns composite type

Поиск
Список
Период
Сортировка
От Teodor Sigaev
Тема Re: Function returns composite type
Дата
Msg-id 3EE6E705.9020001@sigaev.ru
обсуждение исходный текст
Ответ на Re: Function returns composite type  (Joe Conway <mail@joeconway.com>)
Ответы Re: Function returns composite type  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
> 
>> It works fine. But is there way not to point 'as c(qq int4, qq1 int4)'? 
> 
> 
> If you mean, is there a way to leave out the 'as c(qq int4, qq1 int4)', 
> the answer is no. You need to either declare the function to return a 
> determinate data type, or you have to specify the data type at runtime 
> in the query string.
 it's a great pity :(.

But in function I already make TupleDesc:        tupdesc = CreateTemplateTupleDesc(attnum, false);        for (i = 0; i
<attnum; i++) {                sprintf(attname, "z%d", i+1);                TupleDescInitEntry(tupdesc, i+1, attname,
INT4OID,-1, 0, false);        }
 
As I understand, this code makes full description of returning value, including 
types and column's names.
Is this info used anywhere?


-- 
Teodor Sigaev                                  E-mail: teodor@sigaev.ru



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

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: MARKED_FOR_UPDATE && XMAX_COMMITTED == XMAX_INVALID ?
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: PostgreSQL under Windows