aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/arrayfuncs.c
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2018-09-23 22:56:39 -0700
committerNoah Misch <noah@leadboat.com>2018-09-23 22:56:39 -0700
commitd18f6674bd60e923bcdbf0fd916685b0a250c60f (patch)
tree2a97aaa8e9f193e18c8d0d5419fe410b8303c474 /src/backend/utils/adt/arrayfuncs.c
parent73a60051379b35a0bec399edfe369c59e50cc775 (diff)
downloadpostgresql-d18f6674bd60e923bcdbf0fd916685b0a250c60f.tar.gz
postgresql-d18f6674bd60e923bcdbf0fd916685b0a250c60f.zip
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
Diffstat (limited to 'src/backend/utils/adt/arrayfuncs.c')
0 files changed, 0 insertions, 0 deletions