Re: random() (was Re: New GUC to sample log queries) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: random() (was Re: New GUC to sample log queries)
Date
Msg-id 21086.1545859306@sss.pgh.pa.us
Whole thread Raw
In response to Re: random() (was Re: New GUC to sample log queries)  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: random() (was Re: New GUC to sample log queries)  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
Peter Geoghegan <pg@bowt.ie> writes:
> On Wed, Dec 26, 2018 at 12:19 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Replacing random() might actually make that easier not harder, since
>> we'd have more control over what happens when.

> That does seem useful. I'm in favor. But why does the function to seed
> the internal PRNG have to be loadable? Can't it just be
> superuser-only?

That'd work as far as I'm concerned.  (But I can hear Frost wanting
a built-in role for it ;-))

One thing we'd have to think about if we want to take this seriously
is whether a process-wide PRNG state is really adequate; if you're
trying to make a particular call site be deterministic, you'd likely
wish it weren't interfered with by other call sites.  On the flip
side, having more call sites probably makes things more random and
thus better for normal usage.  Not sure how to resolve that tension
(but I don't want to build a whole lot of new infrastructure here).

            regards, tom lane


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Feature: temporary materialized views
Next
From: Robert Haas
Date:
Subject: Re: Shared Memory: How to use SYSV rather than MMAP ?