Re: What seed does random() use if setseed() is not called first?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Carl Sopchak <carl(at)sopchak(dot)me>
Cc: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: What seed does random() use if setseed() is not called first?
Date: 2022-07-23 21:47:19
Message-ID: 1220338.1658612839@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Carl Sopchak <carl(at)sopchak(dot)me> writes:
> <p>There is one point about the documentation for random() and
> setseed() that is missing.  What is used to seed random() if
> setseed() isn't called first?  I assume it's something like
> /dev/random or /dev/urandom, but that's just a guess.  Can someone
> please enlighten me?</p>

We don't document this because it's platform- and version-dependent,
but yeah, generally /dev/urandom or local equivalent.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Carl Sopchak 2022-07-23 21:55:40 Re: What seed does random() use if setseed() is not called first?
Previous Message Carl Sopchak 2022-07-23 21:18:40 What seed does random() use if setseed() is not called first?