20 #include "utils/fmgrprotos.h"
66 if (seed < -1 || seed > 1 || isnan(seed))
68 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
69 errmsg(
"setseed parameter %g is out of allowed range [-1,1]",
115 result = (stddev * z) + mean;
134 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
135 errmsg(
"lower bound must be less than or equal to upper bound"));
158 errcode(ERRCODE_INVALID_PARAMETER_VALUE),
159 errmsg(
"lower bound must be less than or equal to upper bound"));
Numeric random_numeric(pg_prng_state *state, Numeric rmin, Numeric rmax)
TimestampTz GetCurrentTimestamp(void)
Datum now(PG_FUNCTION_ARGS)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_GETARG_FLOAT8(n)
#define PG_RETURN_FLOAT8(x)
#define PG_RETURN_INT64(x)
#define PG_GETARG_INT64(n)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_GETARG_NUMERIC(n)
#define PG_RETURN_NUMERIC(x)
int64 pg_prng_int64_range(pg_prng_state *state, int64 rmin, int64 rmax)
double pg_prng_double(pg_prng_state *state)
void pg_prng_seed(pg_prng_state *state, uint64 seed)
double pg_prng_double_normal(pg_prng_state *state)
void pg_prng_fseed(pg_prng_state *state, double fseed)
#define pg_prng_strong_seed(state)
static void initialize_prng(void)
Datum numeric_random(PG_FUNCTION_ARGS)
static pg_prng_state prng_state
Datum int4random(PG_FUNCTION_ARGS)
Datum setseed(PG_FUNCTION_ARGS)
static bool prng_seed_set
Datum drandom(PG_FUNCTION_ARGS)
Datum drandom_normal(PG_FUNCTION_ARGS)
Datum int8random(PG_FUNCTION_ARGS)