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:25:28
Message-ID: 1112948729.1296.20.camel@retsol1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Steve Tucknott 2005-04-08 08:40:26 Re: CREATE TYPE and %ROWTYPE
Previous Message Steve Tucknott 2005-04-08 07:01:23 Re: CREATE TYPE and %ROWTYPE