> I'm pretty clearly in favor of doing correct lexing. I think we should
> generalize that and make it reusable. psql has it's own hacked up
> version already, there seems little point in having variedly good copies
> around.
I must admit that I do not know how to share lexer rules but have
different actions on them (psql vs sql parser vs ...), as the action code
is intrinsically intertwined with expressions. Maybe some hack is
possible. Having yet another SQL-lexer to maintain seems highly
undesirable, especially just for pgbench.
> I could see including something esimpler, in addition to the lexer, to
> allow sending multiple statements in one go.
Currently, probably
SELECT 1; SELECT 1;
Does 2 statements in one go, but it is on one line.
May by allowing both continuations and ";" at the same time:
-- two statements in one go SELECT 1; \ SELECT 1; -- next statement on it's own SELECT 1;
Which could be reasonnably neat, and easy to implement.
--
Fabien.