"Joshua Tolley" <eggyknap@gmail.com> writes:
> The new \ef psql command creates nicely usable "CREATE OR REPLACE
> FUNCTION ..." text based on the function I tell it to edit, but the
> text it creates *doesn't* include a final semicolon, so when I exit my
> editor-of-choice after messing with my function, it doesn't run the
> code I've given it until I type one of my own. This is annoying.
This is intentional.
If the semicolon is there, the command will be squirted to the backend
instantaneously upon your exiting the $EDITOR. The potential bad
consequences of that seem to me to outweigh the annoyance factor of
typing ; and return.
Now, if you want to fix psql so that even with a semicolon there it
will redisplay the command buffer and wait for a return, then I'd agree
that that's an improvement. I couldn't figure out how to get readline
to cooperate with that ... but I didn't spend a lot of time looking.
regards, tom lane