BUG #17173: Primary Key ignored resulting in duplicate values

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: kdhanjee(at)gmail(dot)com
Subject: BUG #17173: Primary Key ignored resulting in duplicate values
Date: 2021-09-01 09:21:08
Message-ID: 17173-d0151264e4a69eb5@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17173
Logged by: Ketan Dhanjee
Email address: kdhanjee(at)gmail(dot)com
PostgreSQL version: 11.9
Operating system: CentOS Linux 7
Description:

Dear Sir/Madam,

We have found issues on our database tables with duplicate values for tables
defined with primary keys.

Below please find output from one of our tables with duplicate values on the
primary key:

Table DDL:

CREATE TABLE component.priceupdate
(
id bigint NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1
MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1 ),
reference character varying(50) COLLATE pg_catalog."default",
effectivedate timestamp(6) without time zone,
"timestamp" timestamp(6) without time zone,
priceupdatestatus character varying(50) COLLATE pg_catalog."default",
modifieddate timestamp(6) without time zone,
CONSTRAINT priceupdate_pkey PRIMARY KEY (id)
USING INDEX TABLESPACE pgwlicsdb
)
WITH (
OIDS = FALSE
)
TABLESPACE pgwlicsdb;

--------------------------------------------
Select output:

select * from component.priceupdate where id=3001279;

id | reference | effectivedate
| timestamp | priceupdatestatus
| modifieddate
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3001279 1250812673793 2021-03-18 00:00:00
2021-04-06 13:19:14.997 Failed 2021-05-23
12:16:49.503
3001279 1250812673793 2021-03-18 00:00:00
2021-04-06 13:19:14.997 Failed 2021-05-23
12:45:09.206

We have other tables that also have duplicates for primary key.

Could you please provide feedback with regards to my query.

Thanks
Ketan

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-09-01 11:17:18 BUG #17174: ERROR: column "min_value" does not exist at character 19 2021-09
Previous Message PG Bug reporting form 2021-09-01 02:25:31 BUG #17172: NaN compare error in hash agg