postgresql/src
Noah Misch 402da7054f 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:57:43 -07:00
..
backend Initialize random() in bootstrap/stand-alone postgres and in initdb. 2018-09-23 22:57:43 -07:00
bin Support building with Visual Studio 2015 2018-09-11 15:46:35 -04:00
common Unlink static libraries before rebuilding them. 2015-03-01 13:06:39 -05:00
include Fix failure with initplans used conditionally during EvalPlanQual rechecks. 2018-09-15 13:42:34 -04:00
interfaces Reduce an unnecessary O(N^3) loop in lexer. 2018-08-23 21:29:15 +01:00
makefiles Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:32 -04:00
pl Translation updates 2018-08-06 19:30:02 +02:00
port Support building with Visual Studio 2015 2018-09-11 15:46:35 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:02:03 -04:00
test Fix failure in WHERE CURRENT OF after rewinding the referenced cursor. 2018-09-23 16:05:46 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:56:06 -04:00
tools Support building with Visual Studio 2017 2018-09-11 16:05:20 -04:00
tutorial Remove tabs after spaces in C comments 2014-05-06 11:26:28 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04: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 Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:32 -04:00
Makefile.shlib Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:32 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00