Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group