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.96) (envelope-from ) id 1vj4LX-005V8T-0A for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jan 2026 23:44:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vj4LW-00FKQX-03 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Jan 2026 23:44: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.96) (envelope-from ) id 1vj4LV-00FKQO-2I for pgsql-hackers@lists.postgresql.org; Thu, 22 Jan 2026 23:44:14 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vj4LT-001qCi-28 for pgsql-hackers@postgresql.org; Thu, 22 Jan 2026 23:44:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 60MNhs2l3008135; Thu, 22 Jan 2026 18:43:55 -0500 From: Tom Lane To: Dmitry Koval cc: pgsql-hackers@postgresql.org, Joseph Koshakow Subject: Re: Assert when executing query on partitioned table In-reply-to: <0e6230f9-fe30-47ae-912a-0b1b2c94e659@postgrespro.ru> References: <0e6230f9-fe30-47ae-912a-0b1b2c94e659@postgrespro.ru> Comments: In-reply-to Dmitry Koval message dated "Mon, 29 Dec 2025 11:43:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3008133.1769125434.1@sss.pgh.pa.us> Date: Thu, 22 Jan 2026 18:43:54 -0500 Message-ID: <3008134.1769125434@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dmitry Koval writes: > I want to send the patch to Commitfest, so the version changed: > [1] -> [2] (for cfbot). I looked this over and concluded that actually, Joseph Koshakow's proposal upthread is the correct one: just delete the faulty Assert. If we fall through and let the caller retry, we get exactly the same behavior as in the non-partition-movement case, so I'm prepared to accept that behavior as correct. Moreover, I guess users think so too, because this code is pretty old yet we've heard no complaints about the production (no-Asserts) behavior. If we started to throw an error where we hadn't before, I bet we *would* get complaints. Also, I realized that we don't really need an injection point to demonstrate the assertion failure: it's sufficient to make the other session lock the tuple with SELECT FOR UPDATE before we start the INSERT. This is good because it's simpler and it lets the test be back-patched all the way. Pushed at 4b760a181 et al. regards, tom lane