Re: pgbench - allow backslash continuations in \set expressions - Mailing list pgsql-hackers

From Christoph Berg
Subject Re: pgbench - allow backslash continuations in \set expressions
Date
Msg-id 20161003124646.fizunc7gqyfzkriq@msg.df7cb.de
Whole thread Raw
In response to Re: pgbench - allow backslash continuations in \set expressions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pgbench - allow backslash continuations in \set expressions  (Rafia Sabih <rafia.sabih@enterprisedb.com>)
List pgsql-hackers
Re: Fabien COELHO 2016-10-03 <alpine.DEB.2.20.1610031259400.19411@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



pgsql-hackers by date:

Previous
From: Anastasia Lubennikova
Date:
Subject: Re: WIP: Covering + unique indexes.
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Copy-editing for contrib/pg_visibility documentation.