Re: Casting 'record' to a composite type. - Mailing list pgsql-general

From Joe Conway
Subject Re: Casting 'record' to a composite type.
Date
Msg-id 4023CC10.2010102@joeconway.com
Whole thread Raw
In response to Casting 'record' to a composite type.  (Mark Gibson <gibsonm@cromwell.co.uk>)
List pgsql-general
Mark Gibson wrote:
> I'd like to do something like this:
>
>    CREATE TYPE my_type AS (id integer, title text);
>
>    SELECT *
>    FROM fn_returning_setof_record( ... )
>    AS t my_type;
> or
>    SELECT *
>    FROM fn_returning_setof_record( ... )::my_type AS t;

> I've not been able to find anything like this in the docs.
> Is there currently any way of doing this? are there any plans for it?

There is no way to do this now, and no plans that I know of, but it does
look useful. I'm not sure how painful it would be to make it happen
though...

Joe



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: how can I select into an array?
Next
From: Franco Bruno Borghesi
Date:
Subject: Re: Getting table attributes