diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2014-05-29 13:51:05 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2014-05-29 13:51:05 -0400 |
commit | 961dd203a2503ada9c458b79e9dbf43bb478864e (patch) | |
tree | e4128caf155c4f9ec1436ae8a30d056d7bc411c8 /src/backend/tcop/postgres.c | |
parent | 2677bace522cae86fae899c58b58c11d7b45fd56 (diff) | |
download | postgresql-961dd203a2503ada9c458b79e9dbf43bb478864e.tar.gz postgresql-961dd203a2503ada9c458b79e9dbf43bb478864e.zip |
When using the OSSP UUID library, cache its uuid_t state object.
The original coding in contrib/uuid-ossp created and destroyed a uuid_t
object (or, in some cases, even two of them) each time it was called.
This is not the intended usage: you're supposed to keep the uuid_t object
around so that the library can cache its state across uses. (Other UUID
libraries seem to keep equivalent state behind-the-scenes in static
variables, but OSSP chose differently.) Aside from being quite inefficient,
creating a new uuid_t loses knowledge of the previously generated UUID,
which in theory could result in duplicate V1-style UUIDs being created
on sufficiently fast machines.
On at least some platforms, creating a new uuid_t also draws some entropy
from /dev/urandom, leaving less for the rest of the system. This seems
sufficiently unpleasant to justify back-patching this change.
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions