Partial index causing wrong results to be returned on 8.1.3 - Mailing list pgsql-bugs

From Greg Sabino Mullane
Subject Partial index causing wrong results to be returned on 8.1.3
Date
Msg-id 1156824337.4526.12.camel@localhost.localdomain
Whole thread Raw
Responses Re: Partial index causing wrong results to be returned on 8.1.3
List pgsql-bugs
I could not duplicate this on any identical database, but thought I
would report it here, just for completeness. I've tried reindexing,
vacuuming, etc. Explain plans all look normal.

Version is 8.1.3
\d bigtable
...
"bigtable_status_partial" btree (status) WHERE status::text <>
'shipped'::text
=20
=20
greg=3D> select (select count(*) from bigtable where status  =3D 'shipped')
            + (select count(*) from bigtable where status <> 'shipped')
       UNION select count(*) from bigtable;
 ?column?
----------
  1185213
  1600569
=20
greg=3D> drop index bigtable_status_partial;
=20
greg=3D> select (select count(*) from bigtable where status  =3D 'shipped')
            + (select count(*) from bigtable where status <> 'shipped')
       UNION select count(*) from bigtable;
 ?column?
----------
  1185213
(1 row)

--
Greg Sabino Mullane greg@turnstep.com
End Point Corporation
PGP Key: 0x14964AC8 200608290003
http://biglumber.com/x/web?pk=3D2529DF6AB8F79407E94445B4BC9B906714964AC8

pgsql-bugs by date:

Previous
From: "Gin Indexes cause server to crash on Windows"
Date:
Subject: BUG #2595: Gin Indexes cause server to crash on Windows
Next
From: Tom Lane
Date:
Subject: Re: Partial index causing wrong results to be returned on 8.1.3