Richard Huxton <dev@archonet.com> writes:
> I thought it was the PERFORM statements, but it's not. The line number
> seems right, although the error message is misleading.
FWIW, things are better in HEAD:
regression=# create function foo() returns int as $$
regression$# begin
regression$# return;
regression$# end$$ language plpgsql;
ERROR: missing expression at or near ";"
LINE 3: return; ^
regression=#
regards, tom lane