Re: CREATE TYPE and %ROWTYPE

From: Steve Tucknott <steve(at)retsol(dot)co(dot)uk>
To: PostGreSQL <pgsql-novice(at)postgresql(dot)org>
Subject: Re: CREATE TYPE and %ROWTYPE
Date: 2005-04-08 08:40:26
Message-ID: 1112949626.1296.23.camel@retsol1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Ignore the previous mail - I have just found that the simple:
RETURNS tableName
works fine - I was adding the %ROWTYPE unnecessarily.
Apologies.

On Fri, 2005-04-08 at 09:25, Steve Tucknott wrote:
> Tom,
>
> Can I also clarify:
> If I want to return a record area (row) from a table I cannot use:
> RETURNS RECORD or
> RETURNS tableName%ROWTYPE
>
> But I can return a record area (row) If I first define the row as a
> custom type then use:
> RETURNS customType
>
> Am I missing something here? Why do I need to define a custom type to
> return a row?
>
> What I am trying to do is to define a set of standard lookups in the
> database that return the complete record area of the table(s) being
> queried.
>
> On Fri, 2005-04-08 at 08:01, Steve Tucknott wrote:
> > Tom,
> > Is there another trick that I'm missing? Is there a simple way of
> > returning two complete record areas without using custom types?
> > On Fri, 2005-04-08 at 07:51, Tom Lane wrote:
> > > Steve Tucknott <steve(at)retsol(dot)co(dot)uk> writes:
> > > > Before I go too far, has anyone got any ideas on this?
> > >
> > > IIRC, we only support %ROWTYPE with function parameters. I don't think
> > > anyone's thought about what it would take to use it in other contexts
> > > such as columns of composite types. It might be trivial ... or not.
> > >
> > > regards, tom lane
> > --
> >
> >
> > Regards,
> >
> > Steve Tucknott
> > ReTSol Ltd
> >
> > DDI 01903 828769
> > MOBILE 07736715772
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> --
>
>
> Regards,
>
> Steve Tucknott
> ReTSol Ltd
>
> DDI 01903 828769
> MOBILE 07736715772
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
--

Regards,

Steve Tucknott
ReTSol Ltd

DDI 01903 828769
MOBILE 07736715772

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message SG Edwards 2005-04-08 14:09:20 configure to allow TCP/IP connection
Previous Message Steve Tucknott 2005-04-08 08:25:28 Re: CREATE TYPE and %ROWTYPE