Re: add modulo (%) operator to pgbench

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: add modulo (%) operator to pgbench
Date: 2015-01-01 13:02:15
Message-ID: alpine.DEB.2.10.1501011355000.8764@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello David,

> At the moment I feel the patch is a bit half done. I really think that
> since the gaussian and exponential stuff was added in commit ed802e7d, that
> this should now be changed so that we have functions like random(),
> erandom() and grandom() and the way to use this becomes:

> \set name random(1,10)
> \set name erandom(1,10)
>
> And we completely pull out the new \\setrandom additions added in that
> commit. We'd likely keep \\setrandom name 1 10 for backwards compatibility.

> Does anyone else feel strongly about fixing this now, while we have the
> chance?

I thought about adding functions, possibly random, very probably abs &
some hash, but I felt it would be more for a second round.

The other point is that although uniform random is fine, the gaussian and
exponential ones require an additional floating point argument which means
handling some typing.

The current patch is "just" about handling operators as before, although
in a much nicer and extensible way, thus I would suggest to let Robert's
patch more or less as it is, and people will be able to propose new
extensions later on.

--
Fabien.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-01-01 14:11:30 Re: add modulo (%) operator to pgbench
Previous Message Ashutosh Bapat 2015-01-01 10:47:43 Transactions involving multiple postgres foreign servers