Re: Support getrandom() for pg_strong_random() source - Mailing list pgsql-hackers

From Jacob Champion
Subject Re: Support getrandom() for pg_strong_random() source
Date
Msg-id CAOYmi+k-199FZAZqCdg1t_-_5GODp8L_R4UUjqF1hK2j-aZF4g@mail.gmail.com
Whole thread Raw
In response to Re: Support getrandom() for pg_strong_random() source  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Support getrandom() for pg_strong_random() source
List pgsql-hackers
On Tue, Sep 30, 2025 at 12:44 AM Daniel Gustafsson <daniel@yesql.se> wrote:
> What if we instead expand the API to provide pg_random (or pg_fast_random)
> which can be a selectable implementation, and pg_strong_random is left as today
> a compile time selection?

I like the idea of tiering it, but I'm not sure how to communicate to
developers when they should prefer pg_strong_random over
pg_fast_random over pg_prng (which is hopefully faster than
pg_fast_random!).

Is the dividing line really strong vs fast, or is it compliance vs
noncompliance? Because I have a feeling that for some users, the
"fast" alternative that is chosen will be stronger than the "strong"
version they are mandated to select.

Are there any use cases other than UUID that want CSPRNG guarantees
without needing CSPRNG security?

--Jacob



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: Support getrandom() for pg_strong_random() source
Next
From: Andrey Borodin
Date:
Subject: Re: GiST nitpicks I want to discuss (and maybe eventually fix)