Re: Duplicate data even with primary keys enabled

From: Erik Wienhold <ewie(at)ewie(dot)name>
To: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>, Teju Jakkidi vlogs <teja(dot)jakkidi05(at)gmail(dot)com>
Cc: Holger Jakobs <holger(at)jakobs(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Duplicate data even with primary keys enabled
Date: 2022-10-29 00:18:38
Message-ID: 2102110489.726355.1667002718732@office.mailbox.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> On 28/10/2022 22:50 CEST Scott Ribe <scott_ribe(at)elevated-dev(dot)com> wrote:
>
> A corrupted index could allow that to happen by failing to catch the duplicate
> insert. I suppose it might also be able to cause the same row to be returned
> multiple times--although I have personally only ever seen corrupted indexes
> cause rows to not be found.

I think it should be possible to tell those two cases apart by looking at system
column ctid. The ctid should be the same for duplicate rows if the same row is
found multiple times in the index. Different ctid if the corrupted index
allowed INSERT with duplicates.

--
Erik

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jwiencek3 2022-10-29 02:53:30 Re: Duplicate data even with primary keys enabled
Previous Message Marco DE BOOIJ 2022-10-28 21:06:10 Re: Duplicate data even with primary keys enabled