Contents
random()
A function returning a random value
random()
is a system function which returns a random value of 0.0
or greater but less than 1.0
.
random()
has always been present in PostgreSQL.
Usage
random ( ) → double precision
Note that random()
is not considered secure for cryptographic use; see pgcrypto
.
Change history
- PostgreSQL 15
- improved PRNG API and algorithm (commit 3804539e)
- PostgreSQL 9.4
- random seed improved (commit 98c50656)
References
- PostgreSQL documentation: Random Functions