Re: returning SETOF RECORD

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: returning SETOF RECORD
Date: 2014-07-14 20:39:40
Message-ID: 53C4400C.8040108@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 07/14/2014 03:44 PM, Robert Haas wrote:
> populate_record_worker in jsonfuncs.c says this:
>
> if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
> ereport(ERROR,
> (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> errmsg("function returning record called in context "
> "that cannot accept type record"),
> errhint("Try calling the function in the FROM clause "
> "using a column definition list.")));
>
> dblink.c has a similar incantation.
>
> Is there any reasonable alternative? That is, if you have a function
> returning SETOF record, and the details of the record type aren't
> specified, is there anything you can do other than error out like
> this?
>

Not that I can see. What would you suggest?

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-07-14 20:46:48 Re: returning SETOF RECORD
Previous Message Robert Haas 2014-07-14 19:56:30 Re: Minmax indexes