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 1sTOrT-00FrpU-3f for pgsql-general@arkaria.postgresql.org; Mon, 15 Jul 2024 16:47:39 +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 1sTOrR-00BXGJ-QH for pgsql-general@arkaria.postgresql.org; Mon, 15 Jul 2024 16:47:37 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sTOrQ-00BXG8-TW for pgsql-general@lists.postgresql.org; Mon, 15 Jul 2024 16:47:37 +0000 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sTOrK-002C5F-3V for pgsql-general@lists.postgresql.org; Mon, 15 Jul 2024 16:47:35 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 6CC241147C23; Mon, 15 Jul 2024 12:47:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 15 Jul 2024 12:47:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= 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=fm1; t=1721062049; x=1721148449; bh=b0mHCduBiXn7+GbVXV1s3TflEVmawz3FvV/s/rebRv8=; b= OXb7wVk2QtqDG5e+9Q0+S6NTI3qoC/f6sa2cUzFHIiPkkmNgh8xveU7WROnhJHdJ 4dgD9vaBNJJABnuf6WkPbM7D8FUKaLln6pesDZx2dldAUmczJqgAGUtsgNJ/k8Mj amez8P+mKp3oqRkVaBI/8scamFtqzFPL3rHMMn0iy/M5l8JkS212IYdSk3kghOSP Qfp2xCnACiJ0c3bGmDjVxiXua09vfVoGwEqItb/1xAtiZDD8pT6cKEOv+G7psQEo A9iBAyCbjiWQV/7Viet4XZjCrbYy7IU5hrPNFU1w5TqOK79MXGfda6vGdbFJUy2V d35w/I6Tbh08PS6aohChIg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1721062049; x= 1721148449; bh=b0mHCduBiXn7+GbVXV1s3TflEVmawz3FvV/s/rebRv8=; b=h FvFlqAIuMw6LmXGXFG9eP6oLbL9+nICuZfnQgXPim1dAboTexYzXbByMMlInwpNU 3gdVNGkIwNcIFftLzlClSV5EFYYYt+0wt3fkXWO3EWNjc+A17zqgTdZKB/gWr9gI Uw/wPVAZTzGZd9mcLA3mzjDIeqgU2aRrs6o5ixIAoCAXDYvEF8JHtaRokWCC8Tk8 M6dEN4th+OID6Nynqo+jgC1WYkxHe7K2EGdPP/D8xo5E/LNijTC7VG+LKbFv4sWs mXhonhnVUgdLnG6wWSppmgcRnN1lp0ajkJ+69m02hVC88ZtfdQYEhFomBKy9U6Kr n8BKNNdFBB5pNVbEGzycA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrgedvgddutdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeffleegieefgfevudehtdfhkeeutdffjeevgeffgeej vedthefgudeiteefheejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Jul 2024 12:47:28 -0400 (EDT) Message-ID: Date: Mon, 15 Jul 2024 09:47:28 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How does this FK constraint error happen? To: Ron Johnson , "pgsql-generallists.postgresql.org" References: <20240715143518.3v5xdfuj27ryzuzh@hjp.at> <4ff0dd59-9d7b-4a13-ad75-3627080458e1@aklaver.com> <28c88e41-36bc-4704-9c30-f81986f6cdc8@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 7/15/24 09:21, Ron Johnson wrote: > On Mon, Jul 15, 2024 at 11:37 AM Adrian Klaver > > wrote: > > I don't think it is entirely coincidental that 1210 is the only shown > user_id with a modified_on value that is in proximity to the delete > error. > > > I don't think so either. > > My suspicion is that actions are not happening in the exact order > you think they are. > > > modified_on is CURRENT_TIMESTAMP or NOW() or somesuch.  I'm not sure, > because I'm not privy to the code. > > But I'm printing the system time in bash before every statement. That is why I wrote 'Time travel?'. I suspect the modified_on time in the table is not accurately representing when the row is modified. > > I would think that combining DELETE FROM > rel_group_user; and DELETE FROM public.access_user; in a single > transaction would be a good start to fixing this. > > > That is in fact what I'm working on now.  There are 26 tables, and they > must be done in a specific order when deleting, and the reverse while > inserting. > > postgres_fdw would make this easier... It can't be installed? -- Adrian Klaver adrian.klaver@aklaver.com