I recently referred to the manual (section 23.3) to work out how to write a PL/PgSQL function that accepted a row as a parameter.
Reading between a few lines I got the impression that the manual suggested something like: CREATE or REPLACE myfunc( tablename%ROWTYPE ) RETURNS ... When I finally got my function working, I found I had: CREATE or REPLACE myfunc( tablename ) RETURNS ... This is brilliant :-), and in fact the manual foreshadows it: "although one might expect a bare table name to work as a type declaration, it won't be accepted within <application>PL/pgSQL</application> functions." So I guess the manual needs a little update there, or perhaps the syntax that I used only works in the variable list, so I was lucky. I would happily supply a patch to the documentation myself, except that I don't really know what the correct answer is! The docs get a bit hazy in this area regarding the differences between function parameters, declared variables and declared aliases. If someone wants to supply me with the lowdown (or tell me who they are and I can quiz them :-) then I will produce a patch for this area. I'm doing this under 7.2.1, but I've checked CVS as far as I am able and this appears not to have changed. Regards, Andrew. -- -------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267 Are you enrolled at http://schoolreunions.co.nz/ yet? ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster