Re: pgsql: Set random seed for pgbench. - Mailing list pgsql-committers

From Michael Paquier
Subject Re: pgsql: Set random seed for pgbench.
Date
Msg-id 20180401072208.GB2211@paquier.xyz
Whole thread Raw
In response to Re: pgsql: Set random seed for pgbench.  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: pgsql: Set random seed for pgbench.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Sat, Mar 31, 2018 at 07:43:38PM +0200, Fabien COELHO wrote:
> Indeed, I clearly misunderstood its usage pattern. I looked at its source
> ("src/port/pg_strong_random.c") where the function is always defined and is
> documented as returning false if it does not find a strong random source, so
> I though that checking for this was enough. But indeed its
> compilation fails if no source is provided.

I have not check in details this thread so I may be saying something
stupid...  But if you are looking for a frontend implementation for
strong randoms, please extract pg_frontend_random in fe-auth-scram.c and
move it to its own file for example in src/common as a frontend-only
file.  When working on SCRAM, I recall mentioning that but Heikki has
kept the code in its current shape for simplicity.

As far as I can see, there is no reason to issue an error in
set_random_seed() either in pgbench code.
--
Michael

Attachment

pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: Fix non-portable use of round().
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Set random seed for pgbench.