Re: Use of %ROWTYPE in plpgsql function declarations

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Use of %ROWTYPE in plpgsql function declarations
Date: 2005-12-04 06:06:51
Message-ID: 1133676411l.28211l.8l@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 12/03/2005 11:31:34 PM, Tom Lane wrote:
> "Karl O. Pinc" <kop(at)meme(dot)com> writes:
> > Speaking of documentation, it's none too clear that
> > %ROWTYPE does not seem to work when declaring plpgsql
> > functions.
>
> There is noplace that claims that it does. Perhaps you
> are looking for %TYPE?

Nope. I saw this:
----<snip>-----
36.4.3. Row Types
...
Parameters to a function can be composite types (complete table
rows). In that case, the corresponding identifier $n will be a row
variable, and fields can be selected from it, for example $1.user_id.
----<snip>-----

and figured that if it was a row variable I could/should declare it
as such when defining the function. It just seemed a little wierd
not to have the %ROWTYPE because AFIK you need it when declaring
in plpgsql's DECLARE and otherwise the function argument declarations
look like DECLARE declarations.

No biggie. Figured I'd throw it out there (to keep me away
from my real work. ;)

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Assad Jarrahian 2005-12-04 06:33:02 keeping track of inserts (periodical) into a table
Previous Message Karl O. Pinc 2005-12-04 05:39:35 Use of %ROWTYPE in plpgsql function declarations