I am aware of using
psql to edit the query in the buffer.
But what if you are currently creating the query for the first time and want to jump to the editor?
Or better, you go through history to a previous, expensive, query and want to add some edits before.
A nasty trick could be going to the first char of the line an add a comment (
/*) and the same at the end, but something like C-xC-e in the shell will be great.