Re: pgbench - allow backslash continuations in \set expressions

From: Rafia Sabih <rafia(dot)sabih(at)enterprisedb(dot)com>
To: Christoph Berg <myon(at)debian(dot)org>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench - allow backslash continuations in \set expressions
Date: 2016-11-01 07:19:34
Message-ID: CAOGQiiP_7bJ2-+yspBnsQJUzV6A+Fk=9MgJQ2h9y4ic_i7=BEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hie Fabien,
Seems like an interesting addition to pgbench interface, but not sure where
it's required, it'll be good if you may provide some cases where it's
utility can be witnessed. Something like where you absolutely need
continuations in expression.

While applying it is giving some trailing whitespace errors, please correct
them.
As an additional comment you may consider reformatting following snippet

> {continuation} { /* ignore */ }
>
> as

> {continuation} {
> /* ignore */
> }

Thanks.

On Mon, Oct 3, 2016 at 6:16 PM, Christoph Berg <myon(at)debian(dot)org> wrote:

> Re: Fabien COELHO 2016-10-03 <alpine(dot)DEB(dot)2(dot)20(dot)1610031259400(dot)19411(at)lancre>
> > > I "\set" a bunch of lengthy SQL commands in there, e.g.
> >
> > I agree that this looks like a desirable feature, however I would tend to
> > see that as material for another independent patch.
>
> Sure, my question was by no means intending to stop your pgbench patch
> from going forward by adding extra requirements.
>
> > Hmmm. I'm not sure how this is parsed. If this is considered a string
> '...',
> > then maybe \set should wait for the end of the string instead of the end
> of
> > the line, i.e. no continuation would be needed...
> >
> > \set config '
> > SELECT name, ...
> > CASE ... END
> > FROM pg_settings
> > WHERE ...;'
>
> I guess that would be the sane solution here, yes. Not adding any \
> chars at the end of the line would also mean cut-and-paste of the RHS
> content would work.
>
> Thanks for the feedback!
>
> Christoph
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-11-01 07:53:11 Re: commit fest manager for CF 2016-11?
Previous Message Haribabu Kommi 2016-11-01 07:10:10 Re: [BUGS] BUG #14350: VIEW with INSTEAD OF INSERT TRIGGER and COPY. Missing feature or working as designed.