Re: replace oidrand() with random_sample() - Mailing list pgsql-patches

From Neil Conway
Subject Re: replace oidrand() with random_sample()
Date
Msg-id 1042742040.20006.90.camel@tokyo
Whole thread Raw
In response to Re: replace oidrand() with random_sample()  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: replace oidrand() with random_sample()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Wed, 2003-01-15 at 23:45, Christopher Kings-Lynne wrote:
> C'mon guys!  We really have to leave it!  It's of no consequence to us to
> leave it there

It is, though. Continuing to maintain old, crufty code that is no longer
used *does* have a finite cost. Consider the security holes during
7.2.x: the majority of those were found in code that was written years
ago, and only occaisonally looked at since (e.g. the geometry types).

> backwards compatibility is really, really important!

Agreed, but given that this feature

    (a) was completely undocumented

    (b) strangely named

You would have to try *pretty hard* just to know that it existed. And
even if you decided to use it in an application, it won't take much more
than grepping for 'oidrand' and replacing it with 'random() < 1.0/y' in
order to upgrade to 7.4.

(That's in contrast to things like tightening the rules for varchar
input, which aren't trivial to workaround -- in *that* case, I can see
the need for special arrangements for backward-compatibility...)

Cheers,

Neil

P.S. Is there a reason for keeping nullvalue() and nonnullvalue() in
misc.c?

--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC




pgsql-patches by date:

Previous
From: Rod Taylor
Date:
Subject: Re: ALTER TABLE .. SET WITHOUT OIDS -- ROUND 2
Next
From: Peter Eisentraut
Date:
Subject: Re: ALTER TABLE .. SET WITHOUT OIDS -- ROUND 2