Re: Passing RECORD variable from func1() to func2()

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Henry Combrinck <henry(at)metroweb(dot)co(dot)za>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Passing RECORD variable from func1() to func2()
Date: 2004-09-06 21:23:31
Message-ID: 20040906212331.GB24886@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 06, 2004 at 10:39:54PM +0200, Henry Combrinck wrote:

> Can you give an example of what a "named rowtype" is? Are you refering to
> creating some kind of custom TYPE, and then passing that to
> func2(custom_type_row)?

You can use a table's rowtype, that is, a type that has the name of the
table and the same column types. Or you can create a "standalone type" with

CREATE TYPE foo AS (f1 int, f2 text, ...)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Find a bug in a program, and fix it, and the program will work today.
Show the program how to find and fix a bug, and the program
will work forever" (Oliver Silfridge)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message NTPT 2004-09-06 22:23:56 Re: Index on TEXT versus CHAR(32)... fast exact TEXT matching
Previous Message Tom Lane 2004-09-06 21:17:55 Re: Passing RECORD variable from func1() to func2()