1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

With Joe Conway's concurrence, remove srandom() call from normal_rand().

This was the last piece of code that took it upon itself to reset the
random number sequence --- now we only have srandom() in postmaster start,
backend start, and explicit setseed() operations.
This commit is contained in:
Tom Lane
2003-09-13 21:44:50 +00:00
parent 94a13b8a11
commit c472b8366f
5 changed files with 9 additions and 18 deletions

View File

@ -165,8 +165,8 @@ typedef struct crosstab_hashent
* normal_rand - return requested number of random values
* with a Gaussian (Normal) distribution.
*
* inputs are int numvals, float8 lower_bound, and float8 upper_bound
* returns float8
* inputs are int numvals, float8 mean, and float8 stddev
* returns setof float8
*/
PG_FUNCTION_INFO_V1(normal_rand);
Datum
@ -213,12 +213,6 @@ normal_rand(PG_FUNCTION_ARGS)
funcctx->user_fctx = fctx;
/*
* we might actually get passed a negative number, but for this
* purpose it doesn't matter, just cast it as an unsigned value
*/
srandom(PG_GETARG_UINT32(3));
MemoryContextSwitchTo(oldcontext);
}