Re: Passing RECORD variable from func1() to func2() - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Passing RECORD variable from func1() to func2()
Date
Msg-id 20040906212331.GB24886@dcc.uchile.cl
Whole thread Raw
In response to Re: Passing RECORD variable from func1() to func2()  ("Henry Combrinck" <henry@metroweb.co.za>)
List 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)


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Passing RECORD variable from func1() to func2()
Next
From: "NTPT"
Date:
Subject: Re: Index on TEXT versus CHAR(32)... fast exact TEXT matching