Invent random_normal() to provide normally-distributed random numbers.
Tom Lane <tgl@sss.pgh.pa.us>
Invent random_normal() to provide normally-distributed random numbers. There is already a version of this in contrib/tablefunc, but it seems sufficiently widely useful to justify having it in core. Paul Ramsey Discussion: https://postgr.es/m/CACowWR0DqHAvOKUCNxTrASFkWsDLqKMd6WiXvVvaWg4pV1BMnQ@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +25 −1 |
| src/backend/catalog/system_functions.sql | modified | +7 −0 |
| src/backend/utils/adt/float.c | modified | +35 −5 |
| src/bin/pgbench/pgbench.c | modified | +3 −21 |
| src/common/pg_prng.c | modified | +36 −1 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_proc.dat | modified | +4 −0 |
| src/include/common/pg_prng.h | modified | +1 −0 |
| src/test/regress/expected/random.out | modified | +28 −0 |
| src/test/regress/sql/random.sql | modified | +24 −0 |
Documentation touched
Discussion
- [PATCH] random_normal function 47 messages · 2022-12-08 → 2025-10-19