Re: pgbench - allow backslash-continuations in custom scripts - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench - allow backslash-continuations in custom scripts
Date
Msg-id alpine.DEB.2.10.1506200913180.31742@sto
Whole thread Raw
In response to Re: pgbench - allow backslash-continuations in custom scripts  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
>> I tend to agree on that bottom line; having this be inconsistent with psql
>> does not seem like a win.
>>
>>> I'm not clear on why we'd need a full SQL lexer.
>>
>> So you don't get fooled by semicolons embedded in string literals or
>> comments.
>
> I take it we ignore those now?  I mean, personally, it wouldn't break
> anything for me but since some other benhcmarks involve random text
> generators ....

If backward compatibility is not an issue (I'm surprised:-), and failure 
is acceptable in contrived cases, a simple implementation would be to 
accumulate lines till one ends with ";\s*$",

Otherwise maybe the "states" management or the lexer are enough (in simple 
quotes, in double quotes, in comment, in stuff), so this can implemented 
without actually requiring another lexer in pgbench and be robust.

-- 
Fabien.



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Inheritance planner CPU and memory usage change since 9.3.2
Next
From: Michael Paquier
Date:
Subject: Re: The real reason why TAP testing isn't ready for prime time