Re: (SETOF) RECORD AS complex_type

From: David Fetter <david(at)fetter(dot)org>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: (SETOF) RECORD AS complex_type
Date: 2006-12-28 00:37:24
Message-ID: 20061228003724.GH22284@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 27, 2006 at 06:11:55PM -0600, Andrew Dunstan wrote:
> Tom Lane wrote:
> > David Fetter <david(at)fetter(dot)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.
> >
> > You could possibly do something with a cast:
> >
> > FROM CAST(myfunc(...) AS typename) [ AS alias ]
> >
> > This is at least syntactically OK. Not sure what the implementation
> > issues might be.
> >
>
>
> For some time now I have wanted to genaralise the use of LIKE in type
> expressions, which might perhaps fit David's need. Something like
>
> SELECT * from foo() AS bar (LIKE blurfl);
>
> The nice thing about this is that you could augment the type expression:
>
> SELECT * from foo() AS bar (extra_info text, LIKE blurfl);

That would be really handy. As with CREATE TABLE, you could pile
together several LIKEs and get whatever you needed :)

Cheers,
D

--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2006-12-28 01:11:52 Re: Load distributed checkpoint
Previous Message Andrew Dunstan 2006-12-28 00:11:55 Re: (SETOF) RECORD AS complex_type