pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Wienhold <ewie@ewie.name>
To: Scott Ribe <scott_ribe@elevated-dev.com>
To: Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>
Cc: Holger Jakobs <holger@jakobs.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Duplicate data even with primary keys enabled
Date: Sat, 29 Oct 2022 02:18:38 +0200 (CEST)
Message-ID: <2102110489.726355.1667002718732@office.mailbox.org> (raw)
In-Reply-To: <CECDAF83-106B-4425-865C-176B170CA56D@elevated-dev.com>
References: <CAAo1mbnEV6QxHwnV6r2EUMXjb_Fz98+8eO6ZRU7eux4FTuF0YA@mail.gmail.com>
	<59B1180A-4A4B-4A1A-B50A-C9D9B41AA67D@gmail.com>
	<74e777cb-c332-3db7-7c4a-784d408227d6@jakobs.com>
	<CAKA2XvaFawqTiRtnYKEz84x4A9rDcY2vDCY2SbkS3e2cNKxLng@mail.gmail.com>
	<032E52B8-00C2-431D-BBAF-DCFCCEA817D2@elevated-dev.com>
	<CAKA2XvYoEw0qbMKmnk686gOKe+FrR22R14S6Ts1aY96+ExHtgA@mail.gmail.com>
	<CECDAF83-106B-4425-865C-176B170CA56D@elevated-dev.com>

> On 28/10/2022 22:50 CEST Scott Ribe <scott_ribe@elevated-dev.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





view thread (26+ messages)  latest in thread

Message-ID: <2102110489.726355.1667002718732@office.mailbox.org>
Permalink:  ../2102110489.726355.1667002718732@office.mailbox.org/
Also on:    postgresql.org/message-id/2102110489.726355.1667002718732@office.mailbox.org

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ewie@ewie.name, scott_ribe@elevated-dev.com, teja.jakkidi05@gmail.com, holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Duplicate data even with primary keys enabled
  In-Reply-To: <2102110489.726355.1667002718732@office.mailbox.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