pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Samed YILDIRIM <samed@reddoc.net>
Cc: Teju Jakkidi vlogs <teja.jakkidi05@gmail.com>
Cc: Holger Jakobs <holger@jakobs.com>
Cc: pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Duplicate data even with primary keys enabled
Date: Sat, 29 Oct 2022 11:26:24 -0400
Message-ID: <14712.1667057184@sss.pgh.pa.us> (raw)
In-Reply-To: <CAAo1mbm45nJTpp8mY67a7XJUw0Jm=XYTq5teeKu210A0MfCmUQ@mail.gmail.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>
	<CAAo1mbm45nJTpp8mY67a7XJUw0Jm=XYTq5teeKu210A0MfCmUQ@mail.gmail.com>

Samed YILDIRIM <samed@reddoc.net> writes:
> Hi Teja,
> Your columns are varchar. They may seem the same to you due to the tool you
> use. But, it doesn't mean they are identical. There can be leading or
> trailing spaces.

Another thing I'm wondering about is index corruption due to an
operating-system upgrade that changed string sort ordering.
Nothing might be obviously wrong right after the upgrade, but
index searches would probably fail to find existing entries,
which could lead to not rejecting duplicate entries.

This is, sadly, not at all hypothetical or uncommon.
There's some info about this hazard at:

https://wiki.postgresql.org/wiki/Locale_data_changes

			regards, tom lane





view thread (26+ messages)  latest in thread

Message-ID: <14712.1667057184@sss.pgh.pa.us>
Permalink:  ../14712.1667057184@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/14712.1667057184@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, samed@reddoc.net, teja.jakkidi05@gmail.com, holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Duplicate data even with primary keys enabled
  In-Reply-To: <14712.1667057184@sss.pgh.pa.us>

* 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