postgresql/src
Noah Misch 4232cff11b 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:42 -07:00
..
backend Initialize random() in bootstrap/stand-alone postgres and in initdb. 2018-09-23 22:56:42 -07:00
bin Initialize random() in bootstrap/stand-alone postgres and in initdb. 2018-09-23 22:56:42 -07:00
common Minor cleanup/future-proofing for pg_saslprep(). 2018-09-08 18:20:36 -04:00
fe_utils Fix lexing of standard multi-character operators in edge cases. 2018-08-23 21:43:55 +01:00
include Use size_t consistently in dsa.{ch}. 2018-09-22 00:42:17 +12:00
interfaces ecpg: Change --version output to common style 2018-09-12 14:34:53 +02:00
makefiles Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:31 -04:00
pl Translation updates 2018-08-06 20:03:55 +02:00
port Make snprintf.c follow the C99 standard for snprintf's result value. 2018-08-15 17:25:50 -04:00
template Remove "sco" and "unixware" ports. 2016-10-11 11:26:04 -04:00
test Fix failure in WHERE CURRENT OF after rewinding the referenced cursor. 2018-09-23 16:05:45 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:55:42 -04:00
tools pgtest: run clean, build, and check stages separately 2018-07-28 15:34:06 -04:00
tutorial Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Build src/test/isolation during "make" and "make install". 2017-11-22 20:18:52 -08:00
Makefile.global.in Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:31 -04:00
Makefile.shlib Use -Bsymbolic for shared libraries on HP-UX and Solaris. 2018-09-10 22:22:12 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00