postgresql/src
Tom Lane e6c3ba7fbf Fix portability problem in pgbench.
The pgbench regression test supposed that srandom() with a specific value
would result in deterministic output from random(), as required by POSIX.
It emerges however that OpenBSD is too smart to be constrained by mere
standards, so their random() emits nondeterministic output anyway.
While a workaround does exist, what seems like a better fix is to stop
relying on the platform's srandom()/random() altogether, so that what
you get from --random-seed=N is not merely deterministic but platform
independent.  Hence, use a separate pg_jrand48() random sequence in
place of random().

Also adjust the regression test case that's supposed to detect
nondeterminism so that it's more likely to detect it; the original
choice of random_zipfian parameter tended to produce the same output
all the time even if the underlying behavior wasn't deterministic.

In passing, improve pgbench's docs about random_zipfian().

Back-patch to v11 where this code was introduced.

Fabien Coelho and Tom Lane

Discussion: https://postgr.es/m/4615.1547792324@sss.pgh.pa.us
2019-01-24 11:31:54 -05:00
..
backend Simplify coding to detach constraints when detaching partition 2019-01-24 11:25:29 -03:00
bin Fix portability problem in pgbench. 2019-01-24 11:31:54 -05:00
common Use perfect hashing, instead of binary search, for keyword lookup. 2019-01-09 19:47:46 -05:00
fe_utils pgbench: add \cset and \gset commands 2019-01-10 13:42:20 -03:00
include Remove argument isprimary from index_build() 2019-01-24 07:57:09 +09:00
interfaces Blind attempt to fix _configthreadlocale() failures on MinGW. 2019-01-23 22:46:45 -05:00
makefiles Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
pl Fix misc typos in comments. 2019-01-23 13:39:00 +02:00
port Use our own getopt() on OpenBSD. 2019-01-18 15:06:26 -05:00
template Yet further rethinking of build changes for macOS Mojave. 2018-11-02 18:54:00 -04:00
test Detach constraints when partitions are detached 2019-01-24 00:01:32 -03:00
timezone Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
tools Change snapshot type to be determined by enum rather than callback. 2019-01-21 17:03:15 -08:00
tutorial Update copyright for 2019 2019-01-02 12:44:25 -05:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in fix typo 2019-01-13 16:43:14 -05:00
Makefile.shlib Ensure static libraries have correct mod time even if ranlib messes it up. 2018-11-29 15:53:44 -05:00
nls-global.mk Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00