From: sing_hijo@outlook.com <sing_hijo@outlook.com>
To: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Issue Report: Unique Constraint Violation Error in PostgreSQL
Date: Wed, 12 Jun 2024 16:55:23 +0800
Message-ID: <TYCP286MB2292336598CF6EC09DA7E6D794C02@TYCP286MB2292.JPNP286.PROD.OUTLOOK.COM> (raw)
Dear PostgreSQL Support Team,
I am writing to report an issue I encountered while working with the PostgreSQL database. Below are the details of the problem:
Problem Description:
I encountered a unique constraint violation error when attempting to insert data into a table.
Steps to Reproduce:
Created the table test_table:CREATE TABLE test_table (
id bigserial PRIMARY KEY,
name varchar
);
ALTER TABLE test_table OWNER TO postgres;
Inserted data into the table:INSERT INTO test_table (name) VALUES ('test1, no insert id');
INSERT INTO test_table VALUES (2, 'test2, insert id');
INSERT INTO test_table (name) VALUES ('test3, no insert id');
Result:
Error message: [23505] ERROR: duplicate key value violates unique constraint "test_table_pkey" Detail: Key (id)=(2) already exists.
Expected Result:
I expected the data to be inserted successfully without encountering a unique constraint violation.
Environment Information:
PostgreSQL Version:PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
Platform Information: Ubuntu-24.04 Linux sin 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Reporting Method:
I am reporting this issue to seek assistance in resolving the unique constraint violation error. Please advise on the appropriate steps to address this issue.
Thank you for your attention to this matter. I look forward to your guidance on resolving this issue.
Best regards,
sing_hijo@outlook.com
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-bugs@postgresql.org
Cc: sing_hijo@outlook.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Issue Report: Unique Constraint Violation Error in PostgreSQL
In-Reply-To: <TYCP286MB2292336598CF6EC09DA7E6D794C02@TYCP286MB2292.JPNP286.PROD.OUTLOOK.COM>
* 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