Re: [GENERAL] PG & random() strangeness

2010-05-04 Thread Marc Schablewski
Hi, On 04.05.2010 18:24, Sergey E. Koposov wrote: > ## select id ,count(*) from tmpx group by (id) having count(*)>1; > id | count > +--- > 0.519465064629912 | 2 > 0.0100625408813357 | 2 > 0.394671014975756 | 2 > (3 rows) > > and > ## selec

Re: [GENERAL] PG & random() strangeness

2010-05-04 Thread Sergey E. Koposov
On Tue, 4 May 2010, Tom Lane wrote: ## select id ,count(*) from tmpx group by (id) having count(*)>1; id | count +--- 0.519465064629912 | 2 0.0100625408813357 | 2 0.394671014975756 | 2 (3 rows) and ## select id from tmpx where id >

Re: [GENERAL] PG & random() strangeness

2010-05-04 Thread Tom Lane
"Sergey E. Koposov" writes: > On Tue, 4 May 2010, Tom Lane wrote: >> They aren't; or at least you've not provided any evidence that they were. > I think I did, since: > ## select id ,count(*) from tmpx group by (id) having count(*)>1; > id | count > +---

Re: [GENERAL] PG & random() strangeness

2010-05-04 Thread Sergey E. Koposov
On Tue, 4 May 2010, Tom Lane wrote: "Sergey E. Koposov" writes: So among 10^5 random numbers there are already 3 collisions. Which doesn't seem right for the function which generate randoms of double precision The underlying random() function only generates 31-bit integers, so Okay, the fa

Re: [GENERAL] PG & random() strangeness

2010-05-04 Thread jus...@magwerks.com
Message from mailto:m...@sai.msu.ru "Sergey E. Koposov" m...@sai.msu.ru at 05-04-2010 06:36:23 PM -- Hello, I'm getting strange results with PostgreSQL random() function. It would be great if someone could either show where I am wrong or PG is wrong. Here is what I do (PG 8.4.3, x86_

Re: [GENERAL] PG & random() strangeness

2010-05-04 Thread Tom Lane
"Sergey E. Koposov" writes: > So among 10^5 random numbers there are already 3 collisions. Which doesn't > seem right for the function which generate randoms of double precision The underlying random() function only generates 31-bit integers, so collisions aren't as improbable as they might seem

[GENERAL] PG & random() strangeness

2010-05-04 Thread Sergey E. Koposov
Hello, I'm getting strange results with PostgreSQL random() function. It would be great if someone could either show where I am wrong or PG is wrong. Here is what I do (PG 8.4.3, x86_64 platform); I basically try to create the table with the column filled with random numbers (either integer