Re: pgbench randomness initialization

From: Chapman Flack <chap(at)anastigmatix(dot)net>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Fabien Coelho <postgresql(dot)org(at)coelho(dot)net>
Subject: Re: pgbench randomness initialization
Date: 2018-03-03 17:41:20
Message-ID: 152009888095.6915.17779297218559586604.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: not tested
Documentation: tested, passed

The patch 8 works and addresses the things I noticed earlier.

It needs s/explicitely/explicitly/ in the docs.

The parsing of the seed involves matters of taste, I guess: if it were a signed int, then
sscanf's built-in %i would do everything those three explicit hex/octal/decimal branches
do, but there's no unsigned version of %i. Then there's strtoul(..., base=0), which accepts
the same choice of bases, but there's no unsigned-int-width version of that. Maybe it
would still look cleaner to use strtoul and just check that the result fits in unsigned int?
As I began, it comes down to taste ... this code does work.

I am not sure about the "idem for :random_seed" part: Does this mean that a value
could be given with -Drandom_seed on the command line, and become the value
of :random_seed, possibly different from the value given to --random-seed?
Is that intended? (Perhaps it is; I'm merely asking.)

-Chap

The new status of this patch is: Waiting on Author

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2018-03-03 17:52:38 Re: [PATCH] Minor fixes for reloptions tests
Previous Message Tom Lane 2018-03-03 17:23:23 Re: WIP: a way forward on bootstrap data