|From:||Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>|
|To:||Heikki Linnakangas <hlinnaka(at)iki(dot)fi>|
|Cc:||Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>|
|Subject:||Re: pgbench - allow backslash-continuations in custom scripts|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
> The home-grown lexer is missing e.g. dollar-quoting support, so this is not
> be parsed correctly:
> do $$
> That would be very nice to handle correctly, I've used DO-blocks in pgbench
> scripts many times, and it's a pain to have to write them in a single line.
Attached is a version which does that (I think), and a test script.
- backslash-commands can be \-continuated
- sql-commands may include $$-quotes and must end with a ';'
- double-dash comments and blank line are skipped.
Obviously it is still a non-lexer hack which can be easily defeated, but
ISTM that it handles non-contrived cases well. Anyway ISTM that dollar
quoting cannot be handle as such and simply by a lexer, it is really an
|Next Message||Andrew Dunstan||2015-07-03 14:37:34||Re: [PATCH] Generalized JSON output functions|
|Previous Message||Michael Paquier||2015-07-03 13:50:11||Re: BUG #13126: table constraint loses its comment|