Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGCEj-001SjX-CX for pgsql-performance@arkaria.postgresql.org; Wed, 27 Nov 2024 07:13:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGCEh-00CdCO-Sl for pgsql-performance@arkaria.postgresql.org; Wed, 27 Nov 2024 07:13:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGCEh-00CdCG-I2 for pgsql-performance@lists.postgresql.org; Wed, 27 Nov 2024 07:13:19 +0000 Received: from mail-lj1-f175.google.com ([209.85.208.175]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tGCEf-004HSY-59 for pgsql-performance@lists.postgresql.org; Wed, 27 Nov 2024 07:13:18 +0000 Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2ffd6882dcbso3338001fa.0 for ; Tue, 26 Nov 2024 23:13:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732691595; x=1733296395; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=VlYDGhV9JceqNjKzyvvWvvvrzkXbMUQyRe3qGAy+CjU=; b=eJz7Ae9cXF/tg/jVjgHsEUmfgyqTokRecYueb73xgKUy55NiJ+oxSrzotYPR9y3cTy xQbHk+f5j1e4GYDya6sG/alM3neM1Y9/RzsdY+DV5TgFPIUqT2EWPKtkOYVYqzZOiL7p JS3KuC/KyXnOD0Fj4luC8obG0menMY4+Iwvd/Z7HZuUalufcP3A5bQIO0CEj29lUoNmq 7fFU48k84xE1203Zi+xy2i+iWbXxuYWpaiwc+DGFN3Ey+7IjB5Qq2CQYiJ8FoSFSV/ws HHgW//5t0uJBF0oLOkLlt049h7erJZ5N8b9OGUQNXw9TCdlUVrqhJ247fwFoquZJCYEk eixQ== X-Forwarded-Encrypted: i=1; AJvYcCX1YMcFDOomtvHM6V5fUv/xC1vtAJh7jrYkfH2zEwBAUYOxuL6NCLnzhnmEr78dJbT0234yFopptrM+SQb9dIUjFw==@lists.postgresql.org X-Gm-Message-State: AOJu0YzkzUx48wnyQKlOQiexnJ7I61LGiEijBM8HhJIh4lDsKVixq4UN zzRyqPiup7CtGx8Sx/R8Lr/wANblzeu7lRK39OUb2IKwiN0qJzxAv184djBINjHQYc2+tIP7/tC q/ouoSqaPjKUotVBmbUdY6os70ks= X-Gm-Gg: ASbGnculh5c4Hg3m2t2oaPCChw1ohkEm+LViYdn1h+IJVTafxTEoZzpCNQ/avXEN5G9 a9Uvb1fyApTPpv8b2WPiP0LhvzLw++w== X-Google-Smtp-Source: AGHT+IEGNyL9gYqhs4tUJ44PGV5c+8Wr/W5VDYXg4hs8QxxJVrpnulzk1IUcRxEx2uFGdHI9yZZaV2YWexoZ6P10Gug= X-Received: by 2002:a2e:be8f:0:b0:2ff:a928:a23e with SMTP id 38308e7fff4ca-2ffd60ac224mr6080941fa.25.1732691594895; Tue, 26 Nov 2024 23:13:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Vitalii Tymchyshyn Date: Wed, 27 Nov 2024 17:13:03 +1000 Message-ID: Subject: Re: Reg. Postgres Unique contraint To: Burcin Yazici Cc: Sajjad Abid , Diomedes Dominguez , pgsql-performance@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000004e7c90627dfb319" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000004e7c90627dfb319 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable We saw it when OS image changed resulting in collation library change, so index lookups started to fail and reindex was needed to fix it. =D1=81=D1=80, 27 =D0=BB=D0=B8=D1=81=D1=82. 2024=E2=80=AF=D1=80. =D0=BE 16:2= 3 Burcin Yazici =D0=BF=D0=B8=D1=88=D0=B5: > hi, > > make sure that the values are really duplicated first.. > > - check the collation of column. > - check accent chars exist. > - check lowercase, uppercase > - check white space, tabs etc. > > burcin > > On 27 Nov 2024, at 07:28, Sajjad Abid wrote: > > =EF=BB=BF > > Version of Postgres is 12.9 > > On Wed, Nov 27, 2024 at 9:49=E2=80=AFAM Diomedes Dominguez < > diomedes.dominguez@gmail.com> wrote: > >> Which version of Postgres are you using? >> >> El mi=C3=A9, 27 de nov de 2024, 00:14, Sajjad Abid >> escribi=C3=B3: >> >>> A column is character varying(50), also on this column a unique >>> constraint is defined, but I found some duplicate values in this column= for >>> some records >>> user_name character varying(50) >>> CONSTRAINT user_name_unq UNIQUE ( user_name ) >>> >>> Kindly help me to resolve this issue. >>> >>> -- >>> >>> >>> *Thanks & Regards, Sajjad Abid* >>> >> > > -- > > > *Thanks & Regards, Sajjad Abid* > > --00000000000004e7c90627dfb319 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
We saw it when OS image changed resulting in collation li= brary change, so index lookups started to fail and reindex was needed to fi= x it.

=D1=81=D1=80, 27 =D0=BB=D0=B8=D1=81=D1=82. 2024=E2=80=AF=D1=80. = =D0=BE 16:23 Burcin Yazici <bu= rcinyazici@gmail.com> =D0=BF=D0=B8=D1=88=D0=B5:
hi,

make sure that= the values are really duplicated first..

- check = =C2=A0the collation of column.=C2=A0
- check accent chars exist.<= /div>
- check lowercase, uppercase
- check white space, tabs = etc.

burcin

On 27 Nov 2024, at 07:28, Sajjad Abid <abidsajjad@gmail.co= m> wrote:

=EF=BB=BF
<= blockquote type=3D"cite">
Version of Postg= res is 12.9

On Wed, Nov 27, 2024 at 9:49=E2=80=AFAM Diomedes Dominguez <<= a href=3D"mailto:diomedes.dominguez@gmail.com" target=3D"_blank">diomedes.d= ominguez@gmail.com> wrote:

Which version of Postgres are you using? <= /p>

El mi= =C3=A9, 27 de nov de 2024, 00:14, Sajjad Abid <abidsajjad@gmail.com> escribi=C3=B3= :
A column is character varying(50), also on this column a unique con= straint=C2=A0is defined, but I found some duplicate values in this column f= or some records
=C2=A0 user_name character varying(50)=C2=A0
<= /div>
=C2=A0 CONSTRAINT=C2=A0 user_name_unq=C2=A0 =C2=A0UNIQUE ( user_name )

Kindly help me to resolve this iss= ue.

--
Tha= nks & Regards,

Sajjad Abid



--
Thanks & Regards,

Sajjad A= bid

--00000000000004e7c90627dfb319--