Re: [PATCH] random_normal function

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Paul Ramsey <pramsey(at)cleverelephant(dot)ca>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] random_normal function
Date: 2022-12-09 04:29:27
Message-ID: Y5K5p0UrxCqv/OhO@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 08, 2022 at 04:44:56PM -0800, Paul Ramsey wrote:
> Final tme, with fixes from cirrusci.

Well, why not. Seems like you would use that a lot with PostGIS.

#include <math.h> /* for ldexp() */
+#include <float.h> /* for DBL_EPSILON */
And be careful with the order here.

+static void
+drandom_check_default_seed()
We always use (void) rather than empty parenthesis sets.

I would not leave that unchecked, so I think that you should add
something in ramdom.sql. Or would you prefer switching some of
the regression tests be switched so as they use the new normal
function?

(Ahem. Bonus points for a random_string() returning a bytea, based on
pg_strong_random().)
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-12-09 04:36:03 Re: add \dpS to psql
Previous Message Michael Paquier 2022-12-09 04:16:08 Re: Allow tests to pass in OpenSSL FIPS mode