BUG #6607: Strange select behavior

From: suvisor(dot)root(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6607: Strange select behavior
Date: 2012-04-22 19:17:39
Message-ID: E1SM2Hz-0000Ox-PP@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6607
Logged by: Sheplyakov Alexander
Email address: suvisor(dot)root(at)gmail(dot)com
PostgreSQL version: 9.1.3
Operating system: Debian GNU/Linux Wheezy kernel ver 3.3.1
Description:

Create test table in such manner:
create table testt (id serial PRIMARY KEY, val text not null);
Populate table with test data:
insert into testt (val) values ('1'), ('2'), ('3'), ('4'), ('5'), ('6'),
('7'), ('8'), ('9');
(repeat next line until table doesn't contain approx 1000000 rows)
insert into testt (id, val) select nextval('testt_id_seq'::regclass),
currval('testt_id_seq'::regclass) + val::integer from testt;

And then, repeat some times such query:
select * from testt where id = (random()* 100000)::integer;

And sometimes it comes out something like this:
id | val
-------+--------
11894 | 15051
29233 | 42198
80725 | 90213
85688 | 100992
88017 | 108075
(5 rows)
Here can be 2, 3 or other rows amount in result... But must be only one!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jochen Erwied 2012-04-23 05:20:26 Re: BUG #6605: wrong type cast from timestamp to timestamptz
Previous Message Kevin Grittner 2012-04-22 16:51:48 Re: BUG #6605: wrong type cast from timestamp to timestamptz