Re: Passing a ROWTYPE to a function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eric Brown <eric(dot)brown(at)propel(dot)com>
Cc: PgSQL General List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Passing a ROWTYPE to a function
Date: 2005-01-05 15:24:29
Message-ID: 27979.1104938669@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eric Brown <eric(dot)brown(at)propel(dot)com> writes:
> CREATE OR REPLACE FUNCTION g2(int) RETURNS int LANGUAGE plpgsql AS '
> DECLARE item t1%ROWTYPE;
> BEGIN
> SELECT INTO item * FROM t1 WHERE x = $1;
> RETURN g1(item);
> END';

This works in 8.0 but not earlier releases --- there was not support in
plpgsql for using whole-row variables in expressions.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Wes 2005-01-05 15:50:00 Re: hundreds of millions row dBs
Previous Message Alan Garrison 2005-01-05 14:49:34 Re: PostgreSQL users on webhosting