Re: pgbench - allow backslash continuations in \set expressions

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Rafia Sabih <rafia.sabih@enterprisedb.com>, Robert Haas <robertmhaas@gmail.com>, PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2016-12-01T14:15:43Z
Lists: pgsql-hackers
Hello Daniel,

>>  - if not, are possible corner case backward incompatibilities introduced
>>    by such feature ok?
>
> In psql, if backslash followed by [CR]LF is interpreted as a
> continuation symbol, commands like these seem problematic
> on Windows since backslash is the directory separator:
>
> \cd \
> \cd c:\somepath\
>
> Shell invocations also come to mind:
> \! dir \

Thanks for pointing out these particular cases. I was afraid of such 
potential issues, hence my questions...

Would requiring a space after the \ to accept these be ok, even if it is 
somehow a regression?

By the way, how does changing directory to a directory with a space in the 
name works? I.e. does "\<space>" already means something for some 
commands?

Given these examples, I'm not sure I see a way out to having continuations 
on all backslash commands without really breaking some stuff... Or maybe 
having continuations for some commands only, but this is exactly what is 
rejected by Tom about my patch...

-- 
Fabien.


Commits

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