Skip site navigation (1) Skip section navigation (2)

Re: (SETOF) RECORD AS complex_type

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: (SETOF) RECORD AS complex_type
Date: 2006-12-27 23:26:06
Message-ID: 20061227232606.GE22284@fetter.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On Wed, Dec 27, 2006 at 06:22:17PM -0500, Tom Lane wrote:
> David Fetter <david(at)fetter(dot)org> writes:
> > What would be involved in fixing the casting operation so that the
> > following would work?
> 
> > CREATE TYPE foo AS (
> >     a INT4,
> >     b INT8,
> >     c POINT,
> >     d TEXT
> > );
> 
> > CREATE FUNCTION bar(output_type TEXT)
> > RETURNS SETOF RECORD
> > ...
> 
> > SELECT * FROM bar('foo') AS foo;
> 
> The problem with that is that "AS foo" already has a meaning, and it's
> not this one.

How about "AS (foo)" ?

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

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-12-27 23:26:47
Subject: Re: [BUGS] BUG #2846: inconsistent and confusing handling of underflows,
Previous:From: Tom LaneDate: 2006-12-27 23:22:17
Subject: Re: (SETOF) RECORD AS complex_type

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group