Hello Tom,
> In short, I want to mark this RWF for today and ask for a version that
> applies globally to all backslash commands in psql and pgbench.
Hmmm.
The modus operandi of backslash command scanning is to switch to possibly
another scanner just after scanning the backslash command, so I did the
simple thing which is to handle this in the expression scanner. A simple
feature achieved with a simple code.
Factoring out the behavior means handling continuations from the master
scanner, probably by using some other intermediate buffer which is then
rescanned...
This implies that all backslash commands share some kind of minimal
lexical convention that \ followed by a (\r|\n|\r\n) is a continuation...
But then what if the backslash command accept quoted strings, should a
continuation still be a continuation inside quotes? If not, how do I know?
Are all currently existing backslash command compatible with a common set
of lexical convention? Or do some commands should accept backslash
continuations and others not, and have to be treated differently and
knowingly by the lexer?
There is also the issue of locating error messages if the continuation is
in another buffer, probably someone will complain.
Basically, many issues arise, all of them somehow solvable, but I'm afraid
with many more lines than my essentially one line patch:-)
I'm not sure such a simple feature deserves so much energy.
--
Fabien.