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 1sTNHO-00FazW-6r for pgsql-general@arkaria.postgresql.org; Mon, 15 Jul 2024 15:06:18 +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 1sTNHK-00Atxy-LW for pgsql-general@arkaria.postgresql.org; Mon, 15 Jul 2024 15:06:14 +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 1sTNHJ-00Atxp-3Q for pgsql-general@lists.postgresql.org; Mon, 15 Jul 2024 15:06:14 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sTNHC-002BPe-Kh for pgsql-general@lists.postgresql.org; Mon, 15 Jul 2024 15:06:11 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id EA79F1388A86; Mon, 15 Jul 2024 11:06:04 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 15 Jul 2024 11:06:04 -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=1721055964; x=1721142364; bh=cIs+bhwFjKKbu/a3jIIlZKl0BGTMyr7JXj+4XVm7GwU=; b= auAEg7u7dArV6YjKbeuFREz00hJPQlckbi7bKXi9uCH7KqU92wn9x5yqPxId2Etk O9ZaMO5s6TqNI8IBjlIviuhSw8NxOA/4kuEY5jebHMVn6+E/chKg7sx8LDOkdJnK q71who+qFolxsvT/gWPiVcXdno5lHH9xK6j2EE/hcNGYvcfAUkGga+IM4vsrfZnO mVM3JFjmVekyGQMA3tw7ZH6kEefXu86V+WXvktzPMTDqSETZhcr63A8d/Go4dcum YzOjYvCNF7b5S4dskc7Eg7OqqbQO/eUBUolYWdMGR+ZF0CP9HsjBWnhp2ObaBkOF ftOUQGu8YnwWxDVdIdKUrQ== 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=1721055964; x= 1721142364; bh=cIs+bhwFjKKbu/a3jIIlZKl0BGTMyr7JXj+4XVm7GwU=; b=c e/0eSIEnQlcuKSeC7uu/FpFutJn1Q59uW5saEV/AABSdXYA2408GnkvAKqE+xpVp dXDyhWL5dScccnazMPGy11TSOzsc8SRuk3YrHbR0Vjnk7sy7FtUnm1z3UBYU/8Uw mHJPoV+3uzFXB4LyCRSYySe3sCJABvnrcgQcB9O25ztbEoUTixDqGJwHohRC32H6 R+o+NOtvflXQ8+3cJAVO1YugP/0mD35RRw2vfu8aeOwak1ZCTPI46eBw8bNOEMfh 2NIPEe/Rt14+eD9u987W3ntodzgwcLhSzTYD8dkZDI76E6lIaASZgt8tIAVUpDYz Mn9juo757DC8gkrT09DEA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrgedvgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekre dttddvjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeffleegieefgf evudehtdfhkeeutdffjeevgeffgeejvedthefgudeiteefheejheenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvg hrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 15 Jul 2024 11:06:02 -0400 (EDT) Message-ID: <4ff0dd59-9d7b-4a13-ad75-3627080458e1@aklaver.com> Date: Mon, 15 Jul 2024 08:06:02 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: How does this FK constraint error happen? To: Ron Johnson , pgsql-general@lists.postgresql.org References: <20240715143518.3v5xdfuj27ryzuzh@hjp.at> 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 07:53, Ron Johnson wrote: > On Mon, Jul 15, 2024 at 10:35 AM Peter J. Holzer > wrote: > [snip] > > > Is it possible that some other process created an entry in > rel_group_user between these two queries? > > That was, in fact, the problem.  At just the wrong time to impact one of > the child databases (TAPd), but not the other two (TAPb and TAPc). > > TAPd=# select * from rel_group_user > where user_id between 1100 and 1300 > order by user_id; >  user_id | group_id | modified_by |       modified_on > ---------+----------+-------------+------------------------- >     1133 |        2 |        1133 | 2024-07-15 08:43:35.669 >     1142 |        2 |        1142 | 2024-07-15 09:05:58.451 >     1147 |        2 |        1147 | 2024-07-15 09:30:37.169 >     1158 |        2 |        1158 | 2024-07-15 09:36:45.142 >     1197 |        2 |        1197 | 2024-07-15 09:52:58.477 >     1210 |        2 |        1210 | 2024-07-15 02:42:09.355  <<<<<<<<<<<<< Time travel? 2024-07-15 02:41:15 Deleting from FISPTAPPGS401DA/TAPd.public.access_user DELETE FROM public.access_user; Or do the cron jobs take that long to execute? How is modified_on created? >     1229 |        2 |        1229 | 2024-07-15 08:33:48.443 >     1242 |        2 |        1242 | 2024-07-15 10:29:51.176 >     1260 |        2 |        1260 | 2024-07-15 07:36:21.182 >     1283 |        2 |        1283 | 2024-07-15 09:48:25.214 >     1288 |        2 |        1288 | 2024-07-15 08:10:33.609 > (11 rows) > > TAPd=# select user_id, login_id, created_on, modified_on > TAPd-# from public.access_user > TAPd-# where user_id = 1210; >  user_id |  login_id  |       created_on        |       modified_on > ---------+------------+-------------------------+------------------------- >     1210 | JORIEUSER3 | 2023-10-20 11:54:24.562 | 2024-07-15 02:42:09.355 > (1 row) -- Adrian Klaver adrian.klaver@aklaver.com