This is very old issues, that i'm fixing again and again...
1) Options -> Schema Compare -> PostgreSQL -> Functions
what is this weird language 'plsql'? And second, you see functions which `returns SETOF record` (or SETOF some_type) as `returns record`!!! And this bug translated to patch generator (so it generates wrong script)... These bugs are hidden and i had some unpleasant problems with them.
Please, use standart functions instead of self-made: