I wrote:
> We could partially fix that by teaching psql to also recognize
> "BEGIN" as the start of the function body.
Looks like we need "RETURN " too, so more or less as attached.
(I didn't bother with a test case yet. \sf wouldn't be too
hard to exercise, but I wonder how we could test \ef portably.)
regards, tom lane