Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEcGg-0004Gz-9U for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Jun 2023 21:00:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qEcGe-0008G8-5X for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Jun 2023 21:00:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEcGd-0008Fz-TT for pgsql-bugs@lists.postgresql.org; Wed, 28 Jun 2023 20:59:59 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qEcGb-000ysH-Fn for pgsql-bugs@lists.postgresql.org; Wed, 28 Jun 2023 20:59:58 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E560C5C01D2; Wed, 28 Jun 2023 16:59:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 28 Jun 2023 16:59:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1687985996; x=1688072396; bh=Yh CCZHxcmjh8ZRfj0GnBll6W85NFcd3wMAUXsrCj9bU=; b=yAxEJRRLcwkDp769AB PtAErbDuc7E3ZIHx64FASZd00xXdm9RRMvLy3C6Uq+oYAh508X5fBny1t+dqLgKY AEbRu7VvEUmj16bmZ0EFs7LtGzOsEJdd1h8eq7bYcSjpYGVtPNqCGoAVxY95PJ5r ZGj/Qy62b1XvlhZtPuc6aoMR4hxmx+RcSMVvbefndF5D9xa8aQ1qEQ9LT//rqdio 15v+pqVYqkH4XoA9gDULLt3qyVuop//dtVwI4HBAoQ2IzFEfm6uI03L+iGqDvT4e 4I9HZVNRvBGNmUsK07Cqe5bv79iVeKz7XIyc2tjDy1P7NNoQknbTe/vJeARuaILN ROWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687985996; x=1688072396; bh=YhCCZHxcmjh8Z Rfj0GnBll6W85NFcd3wMAUXsrCj9bU=; b=i8qTc+hOasAtkLT6EkpFTAR9luSYH T7AFxpa4ifaLkT7Qhj/mOotJ7aUUerxuiY5QRSulZYRbLu/2yaEzqDf/t/N3I6d6 nna/hV4boHxUTioYc7yXM6dfDSJrK/CAgLkTwfP4ouSfrnpPTuZg1WqjPD5yucg8 3rhzZJIUbKrwKpeeHHcQ8x084dFGniFX1TR9Q+5Yp521baQcgC08d+MTmUASVMXc D0LszQWHYyTl8TEzzIPZBXliiVXHMVox3Lr/3G1754if4/gMjgidLjZAnPxPhcTm mnYM2aWP4GliV7DzKqOM2jeDDhvo2zcaYsRSNjhOCm2deaeQ8CHESjyrQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrtddvgdduheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 28 Jun 2023 16:59:56 -0400 (EDT) Date: Wed, 28 Jun 2023 13:59:55 -0700 From: Andres Freund To: Ajinkya Tankhiwale Cc: "pgsql-bugs@lists.postgresql.org" Subject: Re: BUG #18002: Duplicate entries of row possible even after having primary key Message-ID: <20230628205955.7hrmows5ry247xwe@awork3.anarazel.de> References: <18002-00f2b6cb2b9c0b02@postgresql.org> <20230627203640.fkh66zps3p2jpxvd@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-06-28 08:38:03 +0000, Ajinkya Tankhiwale wrote: > CREATE TABLE IF NOT EXISTS offer > ( > action_id bigint NOT NULL DEFAULT nextval('trade.seq_ao_id'::regclass), > action_type character varying COLLATE pg_catalog."default" NOT NULL, > buy_sell_indicator character varying COLLATE pg_catalog."default" NOT NULL, > creation_date_time timestamp without time zone NOT NULL, > modification_date_time timestamp without time zone NOT NULL, > CONSTRAINT pk_ado PRIMARY KEY (action_id) > ); Just to check, the non-detected uniqueness violations are in this table? How exactly are you inserting? As the primary key is using a sequence, you shouldn't even get to the situation that there could be a uniqueness violation. > Interesting point here is, if I create new table then constraint violation is thrown, on old table I could enter duplicate records. > Also, we migrated from el7 to el8. If the relevant constraints were on some form of a string, I'd suspect that you ran into a corrupted index due to collation changes between el7 and el8. But the pkey of the table above is on a bigint... Greetings, Andres Freund