Adding column breaks function with composite type argument

Started by Jeff Eckermannalmost 25 years ago2 messagesgeneral
Jump to latest
#1Jeff Eckermann
jeckermann@verio.net

I created a pl/pgsql function which takes a table row as an argument,
returning a value based on a comparison of two fields in each row.
This worked fine until I did an "ALTER TABLE ... ADD COLUMN ... ;",
whereupon the function failed to work, producing an error message : "ERROR:
query didn't return correct # of attributes for $1"
Dropping and recreating the function made no difference.
Rewriting the function to just take those two fields as arguments is no
biggie, but: why should this fail?

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Jeff Eckermann (#1)
Re: Adding column breaks function with composite type argument

Jeff Eckermann <jeckermann@verio.net> writes:

I created a pl/pgsql function which takes a table row as an argument,
returning a value based on a comparison of two fields in each row.
This worked fine until I did an "ALTER TABLE ... ADD COLUMN ... ;",
whereupon the function failed to work, producing an error message : "ERROR:
query didn't return correct # of attributes for $1"

Fixed in 7.1.1.

regards, tom lane