postgresql/src/bin/initdb
Noah Misch d18f6674bd Initialize random() in bootstrap/stand-alone postgres and in initdb.
This removes a difference between the standard IsUnderPostmaster
execution environment and that of --boot and --single.  In a stand-alone
backend, "SELECT random()" always started at the same seed.

On a system capable of using posix shared memory, initdb could still
conclude "selecting dynamic shared memory implementation ... sysv".
Crashed --boot or --single postgres processes orphaned shared memory
objects having names that collided with the not-actually-random names
that initdb probed.  The sysv fallback appeared after ten crashes of
--boot or --single postgres.  Since --boot and --single are rare in
production use, systems used for PostgreSQL development are the
principal candidate to notice this symptom.

Back-patch to 9.3 (all supported versions).  PostgreSQL 9.4 introduced
dynamic shared memory, but 9.3 does share the "SELECT random()" problem.

Reviewed by Tom Lane and Kyotaro HORIGUCHI.

Discussion: https://postgr.es/m/20180915221546.GA3159382@rfd.leadboat.com
2018-09-23 22:56:39 -07:00
..
po Translation updates 2018-05-21 12:29:52 -04:00
t Fix misc typos, mostly in comments. 2018-07-18 16:17:32 +03:00
.gitignore Add TAP tests for client programs 2014-04-14 21:33:46 -04:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
findtimezone.c Attempt to identify system timezone by reading /etc/localtime symlink. 2018-09-13 12:36:21 -04:00
initdb.c Initialize random() in bootstrap/stand-alone postgres and in initdb. 2018-09-23 22:56:39 -07:00
nls.mk Translation updates 2018-05-21 12:29:52 -04:00