Tom Lane wrote:
> At a minimum this code has to be fixed to understand the difference
> between backslash commands and SQL lines, and not combine them in
> history entries; otherwise we should revert it. I'm leaning to "revert"
> since I haven't actually seen a case where pulling back multiple lines
> helped me ... but maybe that just reflects that I don't retype multiline
> SQL commands all that much.
Reverting or not, this is rather a matter of how annoying it is right now
(for the developers using CVS tip). I think the old behaviour needs
improvement. You could either use \e and have nice editing capabilities, but
have no tab completition, no backslash-commands in between, and your nice
multiple-lines-query fell apart as soon as you exited psql.
I have not tried CVS tip for a while, but what you describe needs fixing.
Backslash-commands should definately work.
Mark <mark@mark.mielke.cc> wrote:
> To check it out, try /bin/zsh (it seems to come with Linux and
> Solaris these days), and type out:
Actually I am quite impressed by the way zsh works, I've just tried it. I
think it could even work that way in psql, including the slash commands. For
everyone who has never tried zsh, now is the time. ;-)
When you edit a multiline function in zsh, you can easily press Control-C,
then type "man zsh", return, and press "up" to continue editing the function
as it was left when you pressed Control-C.
This could work the same way in psql. You edit your query, press Control-C,
issue a backslash command, press up, finish your query.
The zsh that comes with my linux distribution is BSD licensed, so we could
even borrow code. :-)
On the other hand, I don't know if everybody will like it this way. Perhaps
this should be implemented as a "plugin". (Worst case scenario, but I wonder
wether we can make all people happy ever.)
Best Regards,
Michael Paesold