Hi, What is the main goal? Aren't you looking for a solution to simplify arguments declaration? If so then what about using this one: CREATE OR REPLACE FUNCTION totnrchange(t table1) RETURNS integer AS $BODY$ DECLARE tot integer; BEGIN select count(resnr) into tot from table1 where resnr = t.resnr and fnr = t.fnr ... ... -- Sergey Konoplev Blog: http://gray-hemp.blogspot.com / Linkedin: http://ru.linkedin.com/in/grayhemp / JID/GTalk: gray.ru@xxxxxxxxx / Skype: gray-hemp / ICQ: 29353802 -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general