Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ts69e-00F9nq-Mn for pgsql-general@arkaria.postgresql.org; Tue, 11 Mar 2025 20:24:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ts69c-006L7M-G8 for pgsql-general@arkaria.postgresql.org; Tue, 11 Mar 2025 20:24:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ts69c-006L7E-3P for pgsql-general@lists.postgresql.org; Tue, 11 Mar 2025 20:24:44 +0000 Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ts69Y-002Ii3-0i for pgsql-general@postgresql.org; Tue, 11 Mar 2025 20:24:43 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id 069F325401C6; Tue, 11 Mar 2025 16:24:39 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 11 Mar 2025 16:24:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1741724678; x=1741811078; bh=5mhVK1+HEYoH7C30mSERD6Ffs3xF+nbcY7DT0MCCaHc=; b= Lim8jT6wURZXAwS3/HEtrrjYRvydlDvZ/hngdRHnuCAD/E21TH5U+Z9O9DQukIlC y3uU29xwZLkSBzPdg42/UqNglcSmMkOYwI7p0KqY2bJ5kfDJRq9PGy61QmlbmJuX Q33dvywR1HPOfzPUtrhogTaMKteKCL8tnKmJTqBqOhOCa+UA3Uhclxj5LqKFtwVf ect9k27p6zDq50x/xAR4OKUf5nY5YWnpvg5cfClIs+VyCeA7sZ/8h6p7POFGJL2U W4qNCKEiPP4VRl7MM0o5cqOhm7HpEY44Yt7wa+q8KVArmdCnj2/6lXNgSBAtzoGt PKUuUG50dBRa6oakXA1eqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1741724678; x= 1741811078; bh=5mhVK1+HEYoH7C30mSERD6Ffs3xF+nbcY7DT0MCCaHc=; b=j IhB1TimLYHInL5zLn5ntGTSpJ6oTKl0k3GtiNoL6xWvvMVqDAo8KBbQZACU7aDS+ jBBq4PFeU+8J0KArk9EC9Wn/g14LUxKXBTwfF/Rv3piYOvMRPPDCodwQvLJ/TZtW esNG6vgmm71RfARPuMZJmWPBEkrF6HgCsQV5fQQrWDQ5Ns3Zangod3WarjZTb8Sw WLY/wDT9GrQ+yT50CcNiE8C05Zvx7qR/GwJEfUjllCLm3a0zFkVyzKydJZkK+hqe 4CCRqbOHT4e6IlAsg5o9Bo0XtfP9OFLD3e8NlN2abR6ltsbq9zYqv1xwLzvPa2to Lq/I6psCKW0ZLW94Y2pCw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdefudekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkff ggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhirghnucfmlhgr vhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtf frrghtthgvrhhnpedvhfffhffffeehueetfefgiedujeevjeffgfetfeehfeetgeegleek veevffffkeenucffohhmrghinheppggrmhgriihonhdrtghomhdprghmrgiiohhnrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggu rhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspghrtghpthhtohepvd dpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepmhgrrhhksghrrgguhihjuhesohhu thhlohhokhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghrrghlsehpohhsth hgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Mar 2025 16:24:37 -0400 (EDT) Message-ID: Date: Tue, 11 Mar 2025 13:24:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Duplicate Key Values To: mark bradley Cc: pgsql-general References: <9d919848-3fe1-46fd-b343-c5f2931864f7@aklaver.com> <513ddbee-135c-4af2-b6f6-acca667b8d09@aklaver.com> <84aac7bf-5638-4f1f-9772-ace0ea27e848@aklaver.com> <9203d0df-0ddd-4564-a985-59bcfcf1d294@aklaver.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/11/25 12:55, mark bradley wrote: > It happened again.  Now there are no sequences (although there once was). Read my previous post and provide the information requested. Also: 1) Postgres version. 2) Where did you get Postgres from? > > Sequence of data reentry: > > 1. > I reentered the /node_id/s in table node as a primary key. > 2. > I reentered the datasets, in table /dataset/. > 3. > /Node_id/ was already a PK in dataset. > 4. > _I set _/_node_id_/_ to also be a foreign key in _/_dataset_/_._ > 5. > I went back to look at /node/ and see that duplicate key values > appeared. > > > > > Processing nodes are unaffected because I didn't add any data to the > /processing_node/ table. > > Next, I'm going to create a simple database from scratch and see if I > can duplicate this behavior. > > Best regards, > Mark Brady > _amazon.com/author/markjbrady _ > ------------------------------------------------------------------------ > *From:* Adrian Klaver > *Sent:* Tuesday, March 11, 2025 3:37 PM > *To:* mark bradley > *Cc:* pgsql-general > *Subject:* Re: Duplicate Key Values > On 3/11/25 11:52, mark bradley wrote: >> >> >>     there is an index on node_id as it is the Primary Key. >> >>     Why do you think there is not? >> >> My mistake, I misread the output from \d dataset >> >> >> >> Can you elaborate more on point 3. >> >> Are you calling the Foreign Key relationships subclassing? >> >> >> Although I did not explicitly use Postgres to declare inheritance, >> logically speaking table /dataset/ and /processing _node/ inherit or are >> subclasses of /node/ because they are subclasses of /node/ in a dataflow >> diagram. >> >> >> In terms of keys, this is accomplished by having the /node_id/ key in >> the /node/ table appear as a foreign key and as a primary key in both >> the /dataset/ and /processing_node/ tables. > > You will need to show the schema definitions for: > >    node >    dataset >    processing_node > > Best to do using psql \d > > Also in from previous \d dataset there where NOT VALID FK definitions. > > Did you ever run VALIDATE CONSTRAINT against them? > >> >> >> >>     Is there anything in Postgres log at the time you did the above that >>     showed it did more then a REINDEX? >> >> >> Not that I can tell. >> >> >> >> >> Best regards, >> Mark Brady >> _amazon.com/author/markjbrady >_ > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com