Re: pgbench - allow backslash continuations in \set expressions

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2016-11-01T10:53:12Z
Lists: pgsql-hackers

Attachments

> Attached patch does what is described in the title, hopefully. Continuations 
> in other pgbench backslash-commands should be dealt with elsewhere...
>
> Also attached is a small test script.

Here is another approach, with "infered" continuations: no backslash is 
needed, the parsing is pursued if the last token of the line cannot end an 
expression (eg an operator) or if there is an unclosed parenthesis.

I think that backslashes are less surprising for the classically minded 
user, but this one is more fun:-) Also, this version changes a little more 
the scanner because on each token the next state (continued or not) must 
be decided.

-- 
Fabien.

Commits

  1. Allow backslash line continuations in pgbench's meta commands.