Re: pgbench - allow backslash continuations in \set expressions

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench - allow backslash continuations in \set expressions
Date: 2016-11-01 10:53:12
Message-ID: alpine.DEB.2.20.1611011147380.9978@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> 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.

Attachment Content-Type Size
pgbench-set-infered-continuation-1.patch text/x-diff 3.4 KB
cont2.sql application/x-sql 75 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2016-11-01 11:31:03 Re: Fix checkpoint skip logic on idle systems by tracking LSN progress
Previous Message Dilip Kumar 2016-11-01 09:05:58 Re: [BUGS] BUG #14350: VIEW with INSTEAD OF INSERT TRIGGER and COPY. Missing feature or working as designed.