Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 6F81419F04DC for ; Sun, 22 Apr 2012 16:17:55 -0300 (ADT) Received: from mahout.postgresql.org ([98.129.198.123]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SM2ID-0005JJ-G5 for pgsql-bugs@postgresql.org; Sun, 22 Apr 2012 19:17:54 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SM2I0-0006OL-67 for pgsql-bugs@postgresql.org; Sun, 22 Apr 2012 19:17:40 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.72) (envelope-from ) id 1SM2Hz-0000Ox-PP for pgsql-bugs@postgresql.org; Sun, 22 Apr 2012 19:17:39 +0000 Date: Sun, 22 Apr 2012 19:17:39 +0000 Message-Id: Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: BUG #6607: Strange select behavior To: pgsql-bugs@postgresql.org From: suvisor.root@gmail.com X-Pg-Spam-Score: -1.0 (-) X-Archive-Number: 201204/128 X-Sequence-Number: 32879 The following bug has been logged on the website: Bug reference: 6607 Logged by: Sheplyakov Alexander Email address: suvisor.root@gmail.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 =3D (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!