Hello Rafia,

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.

It is never "absolutely needed", you can always put the expression on one longer line.

As an long line example, supposing some other currently submitted patches are committed to pgbench, for implementing tpc-b according to the specification one may write the following:

  \set bid CASE WHEN random(0, 99) < 85 THEN :tbid ELSE :abid + (:abid >= 
:tbid) END


  \set bid                                 \
     CASE WHEN random(0, 99) < 85          \
       THEN :tbid                          \
       ELSE :abid + (:abid >= :tbid)       \

I find the second version more readable, but it is a really matter of taste, obviously.

While applying it is giving some trailing whitespace errors, please correct them.

 sh> git checkout -b tmp
 sh> git apply ~/pgbench-set-continuation-1.patch
 sh> git commit -a

I do not get any errors, and I have not found any trailing spaces in the patch. Could you give me the precise error message you got?

As an additional comment you may consider reformatting following snippet

{continuation} { /* ignore */ }


{continuation} {
/* ignore */

Hmmm... Other lex rules to ignore spaces use the one line syntax, I would prefer to keep it the same as those.


Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to