Re: (SETOF) RECORD AS complex_type - Mailing list pgsql-hackers

From David Fetter
Subject Re: (SETOF) RECORD AS complex_type
Date
Msg-id 20061227234058.GF22284@fetter.org
Whole thread Raw
In response to Re: (SETOF) RECORD AS complex_type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Dec 27, 2006 at 06:36:56PM -0500, Tom Lane wrote:
> David Fetter <david@fetter.org> writes:
> > On Wed, Dec 27, 2006 at 06:22:17PM -0500, Tom Lane wrote:
> >> The problem with that is that "AS foo" already has a meaning, and it's
> >> not this one.
> 
> > How about "AS (foo)" ?
> 
> What if you want to specify an alias?  This doesn't work:
> 
>     FROM myverylongfunctionname(...) AS alias(typename)
> 
> because, again, that syntax already has a meaning.

Oops.

> You could possibly do something with a cast:
> 
>     FROM CAST(myfunc(...) AS typename) [ AS alias ]

Works for me.

> This is at least syntactically OK.  Not sure what the implementation
> issues might be.

I'm not finding any CASTs from RECORD right offhand.  Where might
those be?

Cheers,
D
-- 
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666                             Skype: davidfetter

Remember to vote!


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: (SETOF) RECORD AS complex_type
Next
From: Roman Kononov
Date:
Subject: Re: [PATCHES] [BUGS] BUG #2846: inconsistent and confusing handling