This is a discussion on Re: plpgsql within the pgsql Novice forums, part of the PostgreSQL category; --> dim <dim45@gmx.net> writes: > The error is "Function returning row cannot return null > value". Is the only solution ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| dim <dim45@gmx.net> writes: > The error is "Function returning row cannot return null > value". Is the only solution to this problem to declare function get_a > to return "SET OF a" ? Might not be the only solution, but IMHO it's the correct solution. Your underlying SELECT returns either a row, or no row (or possibly more than one row?) so the function should too. > Am I missing anything or is > record assignment not possible in plpgsql? Your example works fine for me in PG 8.0. There were some improvements in this area since 7.*, though I'm not sure offhand whether they were material to this particular case. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly |