From: mtesfaye@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #7570: WHERE .. IN bug from 9.2.0 not fixed in 9.2.1
Date: Wed, 26 Sep 2012 16:31:40 +0000
Message-ID: <E1TGuWS-00061g-Vz@wrigleys.postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 7570
Logged by: Melese Tesfaye
Email address: mtesfaye@gmail.com
PostgreSQL version: 9.2.1
Operating system: Ubuntu 12.04.1 LTS + Debian 6 (both x86_64
Description:
I had a problem with missing rows in a resultset when using WHERE .. IN
after upgrading to 9.2.0. I was about to file a bug report when I found out
that verion 9.2.1 was just released to address the index visibility issue.
I then upgraded to 9.2.1 and followed the instructions for vacuuming and
rebuilding indices
(http://wiki.postgresql.org/wiki/20120924updaterelease#Steps_for_Users_of_PostgreSQL_9.2).
I still missed rows in the resultset. I ended up downgrading to 9.1.5 and it
works just fine without missing rows.
Here are my examples:
Query 1 - note **no rows returned for pnr_id 2056 ** not the desired
outcome
SELECT DISTINCT(A.*)
FROM pnr_names_t A LEFT
JOIN pnr_itn_v B ON A.pnr_id=B.pnr_id
WHERE A.pnr_id IN(1801,2056) AND B.departure_date_time>=DATE('2012-09-26')
ORDER BY pnr_id ASC,nam_id ASC;
+--------+--------+---------+
| pnr_id | nam_id | pty_num |
+--------+--------+---------+
| 1801 | 3359 | 1 |
| 1801 | 3360 | 1 |
| 1801 | 3361 | 1 |
| 1801 | 3362 | 1 |
+--------+--------+---------+
(4 rows)
Query 2 - note **rows returned for
pnr_id 2056 *** desired outcome. The difference between Query 1 and Query 2
is the presence of two pnr_ids in the IN element in Query 1
SELECT DISTINCT(A.*)
FROM pnr_names_t A LEFT
JOIN pnr_itn_v B ON A.pnr_id=B.pnr_id
WHERE A.pnr_id IN(2056) AND B.departure_date_time>=DATE('2012-09-26')
ORDER BY pnr_id ASC,nam_id ASC;
+--------+--------+---------+
| pnr_id | nam_id | pty_num |
+--------+--------+---------+
| 2056 | 3894 | 1 |
| 2056 | 3895 | 1 |
+--------+--------+---------+
(2 rows)
When using queries against tables directly (that is, without using views),
then the resultset is as expected.
Thanks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: mtesfaye@gmail.com
Subject: Re: BUG #7570: WHERE .. IN bug from 9.2.0 not fixed in 9.2.1
In-Reply-To: <E1TGuWS-00061g-Vz@wrigleys.postgresql.org>
References: <E1TGuWS-00061g-Vz@wrigleys.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox