Re: BUG #15597: possible bug in amcheck/amcheck_next (or corrupted index?)

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: "Dr(dot) Andreas Kunert" <kunert(at)cms(dot)hu-berlin(dot)de>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15597: possible bug in amcheck/amcheck_next (or corrupted index?)
Date: 2019-01-25 17:57:59
Message-ID: CAH2-WzkhPjWn+CXnvUPV=vk3UvRo-8VVc_CNiGKXetzdVc1USg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Jan 17, 2019 at 6:00 AM PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
> select bt_index_check(12345, true);
> -- result: ERROR: heap tuple (0,2) from table "foo" lacks matching index
> tuple within index "i_foo"
>
> Despite the error message I suspect the index being ok since I can find the
> aforementioned tuples by using it:
>
> explain select * from foo where b='b' and c='c'
> -- result: Index Scan using i_foo on foo...
> select * from foo where b='b' and c='c'
> -- result: 2 rows

This looks like the same bug that I'm currently working through here:

https://postgr.es/m/CAH2-WznrVd9ie+TTJ45nDT+v2nUt6YJwQrT9SebCdQKtAvfPZw@mail.gmail.com

I have a draft patch that fixes this, but I haven't quite decided if I
want to commit to the approach I've taken to normalizing TOASTed
tuples. I will definitely fix the externally maintained version
(amcheck_next) once this is settled. Thanks for the report.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Gavin Flower 2019-01-25 23:27:15 Re: How duplicate values inserted into the primary key column of table and how to fix it
Previous Message Michael Paquier 2019-01-25 10:21:21 Re: BUG #15607: Automatic Database Backup shows status Failed