Re: pgsql: Make pgbench use erand48() rather than random(). - Mailing list pgsql-committers

From Robert Haas
Subject Re: pgsql: Make pgbench use erand48() rather than random().
Date
Msg-id CA+TgmoZ_PHpOQ6B+L9CYXzfBzvXr4kX9zBt=_fXFvk1S3UW6MA@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Make pgbench use erand48() rather than random().  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Wed, Aug 3, 2011 at 6:36 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I do however notice a vestigial reference to MAX_RANDOM_VALUE at line
> 1063, which we probably should get rid of.  What I think we probably
> need instead, and don't have, is a check that "max - min + 1" doesn't
> overflow.

Seems reasonable.  Do you want to take care of that, or shall I do it?

Off-hand, the easiest approach seems to be to define SAMESIGN in
pgbench.c using the same definition we employ in various other places,
and then copy the test we use in int4pl().

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Make pgbench use erand48() rather than random().
Next
From: Bruce Momjian
Date:
Subject: pgsql: In documentaiton, clarify which commands have reduced WAL volume