Re: pgsql: Set random seed for pgbench.

2018-04-01 Thread Tom Lane
Michael Paquier writes: > 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 f

Re: pgsql: Set random seed for pgbench.

2018-04-01 Thread Michael Paquier
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

Re: pgsql: Set random seed for pgbench.

2018-03-31 Thread Fabien COELHO
I assumed that pg_strong_random is always available, ... which is wrong. Every other call of it is wrapped in #ifdef HAVE_STRONG_RANDOM, and so must this one be. Indeed, I clearly misunderstood its usage pattern. I looked at its source ("src/port/pg_strong_random.c") where the function is

Re: pgsql: Set random seed for pgbench.

2018-03-31 Thread Tom Lane
Fabien COELHO writes: >> So this patch has ignored the possibility of not having pg_strong_random. > I assumed that pg_strong_random is always available, ... which is wrong. Every other call of it is wrapped in #ifdef HAVE_STRONG_RANDOM, and so must this one be. We can use the same error messag

Re: pgsql: Set random seed for pgbench.

2018-03-31 Thread Fabien COELHO
Hello Tom, Set random seed for pgbench. So this patch has ignored the possibility of not having pg_strong_random. I assumed that pg_strong_random is always available, but may fail with an error if a strong random source is not available, in which case the error message should be enough fo

Re: pgsql: Set random seed for pgbench.

2018-03-30 Thread Tom Lane
Teodor Sigaev writes: > Set random seed for pgbench. So this patch has ignored the possibility of not having pg_strong_random. That's moving the portability goalposts in a way that I do not find acceptable for such a marginal feature. What behavior do you think we should have for platforms witho