Hi,

While fixing the breakage caused by the default number of trailing
digits output for real and double precision, I noticed that first
random() call after setseed(0) doesn't return the same value as 10 and
earlier (I tested 9.4 and later). It changed an expected behavior and
it should be listed in incompatibilities section of the release notes.
Some applications can rely on such behavior.

$ psql postgres
psql (10.4)
Type "help" for help.

postgres=# select setseed(0);
 setseed
---------

(1 row)

postgres=# select random();
      random
-------------------
 0.840187716763467
(1 row)

$ psql postgres
psql (12beta1)
Type "help" for help.

postgres=# select setseed(0);
 setseed
---------

(1 row)

postgres=# select random();
        random
-----------------------
 3.907985046680551e-14
(1 row)

It seems related to the pg_erand48() adoption at the end of the year
[1] (commit 6645ad6bdd81e7d5a764e0d94ef52fae053a9e13).


[1] https://www.postgresql.org/message-id/3859.1545849...@sss.pgh.pa.us


-- 
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


Reply via email to