Re: Function returns composite type

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Function returns composite type
Date: 2003-06-11 08:23:33
Message-ID: 3EE6E705.9020001@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sigaev(dot)ru

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruno Wolff III 2003-06-11 12:03:42 Re: PostgreSQL under Windows
Previous Message Manfred Koizar 2003-06-11 07:21:48 MARKED_FOR_UPDATE && XMAX_COMMITTED == XMAX_INVALID ?