Passing a row (NEW) as function argument

Started by DaVincialmost 25 years ago2 messagesgeneral
Jump to latest
#1DaVinci
bombadil@wanadoo.es

Hello all.

First, thanks for all your help in my (silly) last questions. Now I have a
dude about functions that I can't solve with documentation.

How can I pass a row of a view as an argument to function. I have tried
something like:

create function pepis(view_name) returns integer as .../...

but I think it doesn't work, because when I call function from insert rule
of view, I get an error.

I need this for creating views capables of updating and inserting.

Thanks again for your ideas.

David

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: DaVinci (#1)
Re: Passing a row (NEW) as function argument

DaVinci <bombadil@wanadoo.es> writes:

How can I pass a row of a view as an argument to function. I have tried
something like:

create function pepis(view_name) returns integer as .../...

This case turns out to have exposed a number of bugs in both the
planner and plpgsql. I think I've fixed 'em all, but you might like
to try your example against current sources (CVS, or a snapshot dated
after today) to see if it's fixed for you.

regards, tom lane