From: | momjian(at)postgresql(dot)org (Bruce Momjian - CVS) |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql-server/ oc/src/sgml/func.sgml rc/backend ... |
Date: | 2003-02-13 05:24:04 |
Message-ID: | 20030213052404.90AC347609C@postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: momjian(at)postgresql(dot)org 03/02/13 00:24:04
Modified files:
doc/src/sgml : func.sgml
src/backend/utils/adt: misc.c
src/include/catalog: catversion.h pg_proc.h
src/include/utils: builtins.h
src/test/regress/expected: random.out
src/test/regress/sql: random.sql
Log message:
The "random" regression test uses a function called oidrand(), which
takes two parameters, an OID x and an integer y, and returns "true" with
probability 1/y (the OID argument is ignored). This can be useful -- for
example, it can be used to select a random sampling of the rows in a
table (which is what the "random" regression test uses it for).
This patch removes that function, because it was old and messy. The old
function had the following problems:
- it was undocumented
- it was poorly named
- it was designed to workaround an optimizer bug that no longer exists
(the OID argument is to ensure that the optimizer won't optimize away
calls to the function; AFAIK marking the function as 'volatile' suffices
nowadays)
- it used a different random-number generation technique than the other
PSRNG-related functions in the backend do (it called random() like they
do, but it had its own logic for setting a set and deciding when to
reseed the RNG).
Ok, this patch removes oidrand(), oidsrand(), and userfntest(), and
improves the SGML docs a little bit (un-commenting the setseed()
documentation).
Neil Conway
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian - CVS | 2003-02-13 05:25:25 | pgsql-server/src/backend commands/sequence.c p ... |
Previous Message | Bruce Momjian - CVS | 2003-02-13 05:20:06 | pgsql-server/ oc/src/sgml/ref/alter_table.sgml ... |