Re: pgbench - allow backslash continuations in \set expressions

From: Rafia Sabih <rafia(dot)sabih(at)enterprisedb(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench - allow backslash continuations in \set expressions
Date: 2017-01-11 04:18:57
Message-ID: CAOGQiiP6XJQ6ETqDb2OtVo9KKumfDkmK+DPnLT49GdFteYs8fA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Dec 3, 2016 at 1:52 PM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
>
>> FWIW, I looked a bit further and concluded that probably psqlscan.l
>> doesn't need to be modified; so likely you could do this across all of
>> pgbench's commands without touching psql. That might be an acceptable
>> compromise for now, though I still think that as soon as we have this
>> for pgbench, users will start wanting it in psql.
>
>
> The attached patch adds backslash-return (well newline really) continuations
> to all pgbench backslash-commands.
>
> The attached test uses continuations on all such commands (sleep set
> setshell and shell).
>
> I think that adding continuations to psql should be a distinct patch.
>
> --
> Fabien.

Hello Fabien,
The patch does not apply on the latest head, I guess this requires
rebasing since yours is posted in December. Again, it is giving
trailing whitespace errors (as I reported for the earlier version),
plus it does not apply with git apply, hopefully that would be fixed
once rebased.
Other than that, I observed that if after backslash space is there,
then the command fails. I think it should be something like if after
backslash some spaces are there, followed by end-of-line then it
should ignore these spaces and read next line, atleast with this new
meaning of backslash. Otherwise, it should be mentioned in the docs
that backslash should not be followed by space.

--
Regards,
Rafia Sabih
EnterpriseDB: http://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2017-01-11 04:40:53 Re: postgres_fdw bug in 9.6
Previous Message Bruce Momjian 2017-01-11 02:49:30 Re: WARM and indirect indexes