Re: BUG #17188: Multiple rows are present with same values on a unique column - Mailing list pgsql-bugs

From Julien Rouhaud
Subject Re: BUG #17188: Multiple rows are present with same values on a unique column
Date
Msg-id CAOBaU_aRD2jHsWSks8H_s8LXYpaR2bXC6aLvwg_=E5578wFpZQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #17188: Multiple rows are present with same values on a unique column  (Ashish Kumar <ashish.kumar2@getfareye.com>)
List pgsql-bugs
On Fri, Sep 10, 2021 at 7:36 PM Ashish Kumar
<ashish.kumar2@getfareye.com> wrote:
>
> On Fri, Sep 10, 2021 at 3:36 PM PG Bug reporting form <noreply@postgresql.org> wrote:
>>
>> The following bug has been logged on the website:
>>
>> Bug reference:      17188
>> Logged by:          DBA TEAM
>> Email address:      devops@getfareye.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?



pgsql-bugs by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: BUG #17183: missing websearch_to_tsquery
Next
From: "David G. Johnston"
Date:
Subject: Re: PG12 → PG13 database conversion anomaly: ERROR: function kepler_start_3(double precision, double precision) does not exist