Re: pgbench - add \if support - Mailing list pgsql-hackers

From Dmitry Dolgov
Subject Re: pgbench - add \if support
Date
Msg-id CA+q6zcUCW=shzAZot_Tdmt3uOXA08cR_MfeT0V5ouh5BhOmXvw@mail.gmail.com
Whole thread Raw
In response to Re: pgbench - add \if support  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Responses Re: pgbench - add \if support
List pgsql-hackers
> On 4 January 2018 at 07:32, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
>
> Another rebase to try to please the patch tester.

Thanks for working on this. I had just a quick look at it, but I hope I'll have
time to post a proper review. In the meantime I'm wondering what am I doing
wrong here (I see a similar example in your first message)?

```
-- test.sql
\if random(0, 99) < 85
    \set test 1
\else
    \set test 2
\endif
select :test;
```

```
$ pgbench -s 10 -f test.sql
test.sql:1: unexpected character (<) in command "if"
\if random(0, 99) < 85
                  ^ error found here
```

I'm using `pgbench-if-4.patch`, and everything is fine for simple
conditions like `\if 1`.


pgsql-hackers by date:

Previous
From: Catalin Iacob
Date:
Subject: Re: Doc tweak for huge_pages?
Next
From: Shubham Barai
Date:
Subject: Re: [HACKERS] GSoC 2017 : Patch for predicate locking in Gist index