Slashdot Mirror


PostgreSQL Beta Testers Needed

aliensexfiend writes ""PostgreSQL Beta Testing has begun. The more testers, the merrier. Read the announcement page as well as the Beta info page. Interesting new features include a new Binary I/O protocol, ability to inline simple SQL functions, and an error message wording scheme that provides 3 layers of detail!!.""

1 of 26 comments (clear)

  1. Re:oidrand() by nconway · · Score: 3, Insightful
    Since I was responsible for removing oidrand(), I should probably speak up in my own defense :-)

    The motivation for removing oidrand() was that:

    1. it was undocumented
    2. it was poorly named
    3. it was crufty: the unused OID argument is intended to workaround an optimizer bug that has been fixed for years
    4. it didn't play nicely with other portions of the backend that also use a PNRG.


    Note that it is easy to workaround this change: you can either replace references to oidrand(123, y) with 'random() < 1.0/y', or just define the following function:


    CREATE FUNCTION oidrand(oid, int) RETURNS bool AS 'SELECT random() < 1.0/$2' LANGUAGE sql;


    The former being arguably cleaner, the latter meaning that you won't need to change a single line of application code.

    For more information, the thread on pgsql-patches discussing the change is here.

    I'm pretty convinced that removing oidand() is justified, but if you feel otherwise, please speak up. Thanks for raising the issue.