Re: BUG #17188: Multiple rows are present with same values on a unique column

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Ashish Kumar <ashish(dot)kumar2(at)getfareye(dot)com>
Cc: Fareye DevOps <devops(at)getfareye(dot)com>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Saroj K Mohapatra <saroj(dot)mohapatra(at)getfareye(dot)com>
Subject: Re: BUG #17188: Multiple rows are present with same values on a unique column
Date: 2021-09-10 11:47:12
Message-ID: CAOBaU_aRD2jHsWSks8H_s8LXYpaR2bXC6aLvwg_=E5578wFpZQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Sep 10, 2021 at 7:36 PM Ashish Kumar
<ashish(dot)kumar2(at)getfareye(dot)com> wrote:
>
> On Fri, Sep 10, 2021 at 3:36 PM PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:
>>
>> The following bug has been logged on the website:
>>
>> Bug reference: 17188
>> Logged by: DBA TEAM
>> Email address: devops(at)getfareye(dot)com
>> PostgreSQL version: 9.6.22
>> Operating system: Ubuntu 20.04.2 LTS
>> Description:
>>
>> We are having a table Users in which multiple columns named emp_code and
>> company_id have a unique constraint applied to them.But for multiple rows
>> there are values which are equal for both of the columns.
>>
>> Users table definition
>> Table "public.users"
>> [...]
>> Indexes:
>> "users_pkey" PRIMARY KEY, btree (id)
>> "users_company_id_emp_code_key" UNIQUE CONSTRAINT, btree (company_id,
>> emp_code)
>>
>> Here is the sample data
>> select id,company_id,emp_code from users where
>> emp_code='4742_bpl-14_bpl';
>>
>> id | company_id | emp_code
>> ------+------------+-----------------
>> 5065 | 8 | 4742_bpl-14_bpl
>> 1594 | 8 | 4742_bpl-14_bpl

It looks like an index corruption. Is there any chance you can try
amcheck (it should be available with ppgdg packages, but if needed:
https://github.com/petergeoghegan/amcheck) and verify the
users_company_id_emp_code_key (and possibly the other) index?

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2021-09-10 13:02:04 Re: PG12 → PG13 database conversion anomaly: ERROR: function kepler_start_3(double precision, double precision) does not exist
Previous Message Etsuro Fujita 2021-09-10 11:42:27 Re: BUG #16583: merge join on tables with different DB collation behind postgres_fdw fails