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 1oobyx-0008Ot-Fm for pgsql-admin@arkaria.postgresql.org; Sat, 29 Oct 2022 02:53:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oobyw-0005a9-0N for pgsql-admin@arkaria.postgresql.org; Sat, 29 Oct 2022 02:53:58 +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 1oobyu-0005Zw-VZ for pgsql-admin@lists.postgresql.org; Sat, 29 Oct 2022 02:53:57 +0000 Received: from resqmta-a1p-077723.sys.comcast.net ([2001:558:fd01:2bb4::9]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oobyp-0002sO-2H for pgsql-admin@lists.postgresql.org; Sat, 29 Oct 2022 02:53:55 +0000 Received: from resomta-a1p-077245.sys.comcast.net ([96.103.145.236]) by resqmta-a1p-077723.sys.comcast.net with ESMTP id obI3o9IDDMly9obyjoksyk; Sat, 29 Oct 2022 02:53:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1667012026; bh=+rkWsyuVH6Jd2MNRmDKZ3XyAAgxYfmOZTFL4cVN8pg4=; h=Received:Received:Content-Type:From:Mime-Version:Subject:Date: Message-Id:To:Xfinity-Spam-Result; b=w5BiNwXO2ZN5pyspM52Y+ifK24yrpr4AFdkovGQvMEXDbLWBrAdOC7rDgdQHGsOkz 9P1bpgVHnTGycJ8psHU+xDcvTGrjdCemzH3AhRIt/lJB0suBPhceHnNU6vpov1I5jd Gp1KnHjQNLj8aXrf0QxtdTnRIt2Oyk3DKLZIDbMeo4g9GZ++R1LafwJTM0+uzApVHg lYbVdHPLoBze/8Pk/hlqTQqj2GA9oFrxRQyNFybrCdulbwMmNGA4mSRkSi9kfyr4Fv zcP1jIZy1h/2R5Vutq8dUblnEiHcSIeIjHH6TKGot/3RykA7kqj6pcKrn/fr5Gu8B6 6J1XbuISHx1Tw== Received: from smtpclient.apple ([104.235.93.42]) by resomta-a1p-077245.sys.comcast.net with ESMTPA id obyUoFPxmmu27obyVoFyxh; Sat, 29 Oct 2022 02:53:43 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedvgedrtdejgdeihecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpegtgffhggfufffkfhevjgfvofesrgejmherhhdtjeenucfhrhhomheplfifihgvnhgtvghkfecuoehjfihivghntggvkhefsegtohhmtggrshhtrdhnvghtqeenucggtffrrghtthgvrhhnpeevteetuddtkeefhfelleevvdeffeevteeuheefiedthefhieevjeefhefffedvgeenucfkphepuddtgedrvdefhedrleefrdegvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhephhgvlhhopehsmhhtphgtlhhivghnthdrrghpphhlvgdpihhnvghtpedutdegrddvfeehrdelfedrgedvpdhmrghilhhfrhhomhepjhifihgvnhgtvghkfeestghomhgtrghsthdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopehpghhsqhhlqdgrughmihhnsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehstghothhtpghrihgsvgesvghlvghvrghtvgguqdguvghvrdgtohhmpdhrtghpthhtohepthgvjhgrrdhjrghkkhhiughitdehsehgmhgrihhlrdgtohhmpdhrtghpthhtohephhholhhgvghrsehjrghkohgsshdrtghomh X-Xfinity-VMeta: sc=-100.00;st=legit Content-Type: multipart/alternative; boundary=Apple-Mail-5C39EB76-57A6-4086-A968-14F97640EABB Content-Transfer-Encoding: 7bit From: Jwiencek3 Mime-Version: 1.0 (1.0) Subject: Re: Duplicate data even with primary keys enabled Date: Fri, 28 Oct 2022 21:53:30 -0500 Message-Id: References: Cc: Scott Ribe , Holger Jakobs , pgsql-admin@lists.postgresql.org In-Reply-To: To: Teju Jakkidi vlogs X-Mailer: iPad Mail (19G82) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Apple-Mail-5C39EB76-57A6-4086-A968-14F97640EABB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Is it possible that a column is padded with spaces? I=E2=80=99d check the l= ength of each column. Extra spaces to the right would make the columns un= ique. You can=E2=80=99t tell if the column is padded with blanks from your= query. Checking the length would confirm each column is exactly the same.= Sent from my iPad > On Oct 28, 2022, at 3:42 PM, Teju Jakkidi vlogs = wrote: >=20 > =EF=BB=BF > Hello Scott, >=20 > I am wondering how the query matters here? >=20 > Also, I am just running a simple select from "TEST" with COL1, COL2, COL3 i= n the WHERE condition. > select * from 'TEST" WHERE COL1=3D'3456' AND COL2=3D'76542' AND COL3=3D'5= '; >=20 > The actual Issue is I am unable to figure out why the table is having dupl= icate data in the primary key columns. Or how postgres accepted 2 rows with t= he same combination of the columns in the primary key constraint. I would ex= pect it to throw primary key constraint violation error. >=20 > Regards, > Teja. J. >=20 >=20 >> On Fri, Oct 28, 2022 at 1:27 PM Scott Ribe w= rote: >> > On Oct 28, 2022, at 2:15 PM, Teju Jakkidi vlogs wrote: >> >=20 >> > Also, the values that we are seeing is as below: >> >=20 >> > COL1 COL2 COL3 COL4 COL5 COL6 >> > 1 3456 76542 5 ABC 1234 >> > 1 3456 76542 5 ABC 1234 >> > 2 9872 89765 0 FGT 1234 >> > 3 6547 78659 7 JHL 8790 >> >=20 >> > We already defined COL1, COL2, COL3 as primary keys, but still as you s= ee above in the table output, the first 2 rows has exactly same combination f= or those 3 rows. >>=20 >> What query are you running? >>=20 --Apple-Mail-5C39EB76-57A6-4086-A968-14F97640EABB Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Is it possible that a column is padded with= spaces?   I=E2=80=99d check the length of each column.    Ex= tra spaces to the right would make the columns unique.   You can=E2=80=99= t tell if the column is padded with blanks from your query.   Checking t= he length would confirm each column is exactly the same.

Sent from my iPad

O= n Oct 28, 2022, at 3:42 PM, Teju Jakkidi vlogs <teja.jakkidi05@gmail.com&= gt; wrote:

=EF=BB=BF
Hello Scott,

I am won= dering how the query matters here?

Also, I am just runnin= g a simple select from "TEST" with COL1, COL2, COL3 in the WHERE condition.<= /div>
select * from 'TEST" WHERE COL1=3D'3456' AND  COL2=3D'76542' A= ND COL3=3D'5';

The actual Issue is I am unable to f= igure out why the table is having duplicate data in the primary key columns.= Or how postgres accepted 2 rows with the same combination of the columns in= the primary key constraint. I would expect it to throw primary key con= straint violation error.

Regards,
Teja. J.


On Fri, Oct 28, 2022 a= t 1:27 PM Scott Ribe <scot= t_ribe@elevated-dev.com> wrote:
> On Oct 28, 2022, at 2:15 PM, Teju Jakkidi vlogs &l= t;teja.jakkidi= 05@gmail.com> wrote:
>
> Also, the values that we are seeing is as below:
>
> COL1  COL2    COL3    COL4    COL5&n= bsp;   COL6
> 1     3456    76542   5   =    ABC     1234
> 1     3456    76542   5   =    ABC     1234
> 2     9872    89765   0   =    FGT     1234
> 3     6547    78659   7   =    JHL     8790
>
> We already defined COL1, COL2, COL3 as primary keys, but still as you s= ee above in the table output, the first 2 rows has exactly same combination f= or those 3 rows.

What query are you running?

= --Apple-Mail-5C39EB76-57A6-4086-A968-14F97640EABB--