Re: PL/PGSQL Record type question - Mailing list pgsql-sql

From imad
Subject Re: PL/PGSQL Record type question
Date
Msg-id 1f30b80c0705110940w4dbba2b1j705a44f514843e75@mail.gmail.com
Whole thread Raw
In response to Re: PL/PGSQL Record type question  (Gábriel Ákos <akos.gabriel@i-logic.hu>)
List pgsql-sql
create a function with return type as a RECORD.

CREATE FUNCTION xyz() RETURNS record AS
$$declare abc RECORD;begin abc := (1, 2); return abc;end;
$$
language plpgsql;

And execute the function in this fashion:

select a, b from xyz() as (a int, b int);

Do you like that ...  :-)

--Imad
www.EnterpriseDB.com


On 5/11/07, Gábriel Ákos <akos.gabriel@i-logic.hu> wrote:
> On Fri, 11 May 2007 19:09:07 +0500
> imad <immaad@gmail.com> wrote:
>
> > You might be looking for PostgreSQL RECORD data type.
>
> Thanks. Give me an example please. I saw the documentation already.
>
> >
> > --Imad
> > www.EnterpriseDB.com
> >
> > On 5/11/07, Gábriel Ákos <akos.gabriel@i-logic.hu> wrote:
> > > Hi,
> > >
> > > How should I define a record type (there is no table with this
> > > record type) programmatically in pl/pgsql?
> > > I'd like to return a record with 3 string elements, 2 integers and 1
> > > date.
>
>
>
> --
> Üdvözlettel,
> Gábriel Ákos
> -=E-Mail :akos.gabriel@i-logic.hu|Web:  http://www.i-logic.hu =-
> -=Tel/fax:+3612367353            |Mobil:+36209278894          =-
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>


pgsql-sql by date:

Previous
From: "Rodrigo De León"
Date:
Subject: Re: Convert serial column to regular integer
Next
From: Robins
Date:
Subject: Re: PL/PGSQL Record type question