pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Message fix (I guess this was a cruise replace mistake.)
2+ messages / 2 participants
[nested] [flat]

* pgsql: Message fix (I guess this was a cruise replace mistake.)
@ 2009-04-11 14:11  Peter Eisentraut <petere@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: petere@postgresql.org @ 2009-04-11 14:11 UTC (permalink / raw)
  To: pgsql-committers

Log Message:
-----------
Message fix
(I guess this was a cruise replace mistake.)

Modified Files:
--------------
    pgsql/src/bin/psql:
        print.c (r1.111 -> r1.112)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/print.c?r1=1.111&r2=1.112)




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Add functions to generate random numbers in a specified range.
@ 2024-03-27 10:15  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Dean Rasheed @ 2024-03-27 10:15 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add functions to generate random numbers in a specified range.

This adds 3 new variants of the random() function:

    random(min integer, max integer) returns integer
    random(min bigint, max bigint) returns bigint
    random(min numeric, max numeric) returns numeric

Each returns a random number x in the range min <= x <= max.

For the numeric function, the number of digits after the decimal point
is equal to the number of digits that "min" or "max" has after the
decimal point, whichever has more.

The main entry points for these functions are in a new C source file.
The existing random(), random_normal(), and setseed() functions are
moved there too, so that they can all share the same PRNG state, which
is kept private to that file.

Dean Rasheed, reviewed by Jian He, David Zhang, Aleksander Alekseev,
and Tomas Vondra.

Discussion: https://postgr.es/m/CAEZATCV89Vxuq93xQdmc0t-0Y2zeeNQTdsjbmV7dyFBPykbV4Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e6341323a8da64b18e9af3e75a4578230702d61c

Modified Files
--------------
doc/src/sgml/func.sgml                    |  43 +++-
src/backend/utils/adt/Makefile            |   1 +
src/backend/utils/adt/float.c             |  95 --------
src/backend/utils/adt/meson.build         |   1 +
src/backend/utils/adt/numeric.c           | 219 ++++++++++++++++++
src/backend/utils/adt/pseudorandomfuncs.c | 185 +++++++++++++++
src/common/pg_prng.c                      |  36 +++
src/include/catalog/catversion.h          |   2 +-
src/include/catalog/pg_proc.dat           |  12 +
src/include/common/pg_prng.h              |   1 +
src/include/utils/numeric.h               |   4 +
src/test/regress/expected/random.out      | 360 ++++++++++++++++++++++++++++++
src/test/regress/sql/random.sql           | 164 ++++++++++++++
13 files changed, 1022 insertions(+), 101 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-03-27 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-04-11 14:11 pgsql: Message fix (I guess this was a cruise replace mistake.) Peter Eisentraut <petere@postgresql.org>
2024-03-27 10:15 pgsql: Add functions to generate random numbers in a specified range. Dean Rasheed <dean.a.rasheed@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox