pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: PSA: we lack TAP test coverage on NetBSD and OpenBSD
Date: Fri, 18 Jan 2019 12:56:22 -0500
Message-ID: <29225.1547834182@sss.pgh.pa.us> (raw)
In-Reply-To: <alpine.DEB.2.21.1901180926580.26418@lancre>
References: <9427.1547701450@sss.pgh.pa.us>
	<alpine.DEB.2.21.1901170659210.7416@lancre>
	<21538.1547770868@sss.pgh.pa.us>
	<4615.1547792324@sss.pgh.pa.us>
	<alpine.DEB.2.21.1901180926580.26418@lancre>

Fabien COELHO <coelho@cri.ensmp.fr> writes:
>> all is explained here:
>> https://man.openbsd.org/srandom
>> Or at least most is explained there.

> Yep. They try to be more serious than other systems about PRNG, which is 
> not bad in itself.

> Maybe on OpenBSD pg should switch srandom to srandom_deterministic?

Dunno.  I'm fairly annoyed by their idea that they're smarter than POSIX.
However, for most of our uses of srandom, this behavior isn't awful;
it's only pgbench that has an expectation that the platform random()
can be made to behave deterministically.  And TBH I think that's just
an expectation that's going to bite us.

I'd suggest that maybe we should get rid of the use of both random()
and srandom() in pgbench, and go over to letting set_random_seed()
fill the pg_erand48 state directly.  In the integer-seed case you
could use something equivalent to pg_srand48.  (In the other cases
probably you could do better, certainly the strong-random case could
just fill all 6 bytes directly.)  That would get us to a place where
the behavior of --random-seed=N is not only deterministic but
platform-independent, which seems like an improvement.

			regards, tom lane




view thread (37+ messages)  latest in thread

Message-ID: <29225.1547834182@sss.pgh.pa.us>
Permalink:  ../29225.1547834182@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29225.1547834182@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, coelho@cri.ensmp.fr, pgsql-hackers@lists.postgresql.org
  Subject: Re: PSA: we lack TAP test coverage on NetBSD and OpenBSD
  In-Reply-To: <29225.1547834182@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox