Re: add modulo (%) operator to pgbench

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, "Alvaro Herrera" <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add modulo (%) operator to pgbench
Date: 2014-11-24 12:26:37
Message-ID: 547323FD.7040101@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 09/25/2014 05:10 AM, Robert Haas wrote:
> On Wed, Sep 24, 2014 at 2:34 PM, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> wrote:
>> Sigh.
>>
>> How to transform a trivial 10 lines patch into a probably 500+ lines project
>> involving flex & bison & some non trivial data structures, and which may get
>> rejected on any ground...
>>
>> Maybe I'll set that as a student project.
>
> I think you're making a mountain out of a molehill. I implemented
> this today in about three hours. The patch is attached. It needs
> more testing, documentation, and possibly some makefile adjustments,
> but it seems to basically work.

Looks good to me. The new modulo operator needs documentation, and it
could use a pgindent run, but other than that I think this is ready for
commit.

It would be nice to go even further, and replace process_file,
process_builtin, and process_commands altogether with a Bison parser.
But this is definitely a step in the right direction.

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alex Shulgin 2014-11-24 12:30:52 Re: Turning recovery.conf into GUCs
Previous Message Kouhei Kaigai 2014-11-24 11:57:43 Re: [v9.5] Custom Plan API