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 1pU96c-00057f-65 for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 16:33:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pU96b-0000lN-0c for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Feb 2023 16:33:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU96a-0000lE-NZ for pgsql-hackers@lists.postgresql.org; Mon, 20 Feb 2023 16:33:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU96Y-0004n4-89 for pgsql-hackers@lists.postgresql.org; Mon, 20 Feb 2023 16:33:32 +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 31KGXSfl3582658; Mon, 20 Feb 2023 11:33:28 -0500 From: Tom Lane To: Alexander Lakhin cc: Richard Guo , pgsql-hackers@lists.postgresql.org Subject: Re: Killing off removed rels properly In-reply-to: <36bee393-b351-16ac-93b2-d46d83637e45@gmail.com> References: <229905.1676062220@sss.pgh.pa.us> <1343881.1676313553@sss.pgh.pa.us> <36bee393-b351-16ac-93b2-d46d83637e45@gmail.com> Comments: In-reply-to Alexander Lakhin message dated "Mon, 20 Feb 2023 14:00:00 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3582656.1676910808.1@sss.pgh.pa.us> Date: Mon, 20 Feb 2023 11:33:28 -0500 Message-ID: <3582657.1676910808@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alexander Lakhin writes: > After this change the following query triggers an assert: > CREATE TABLE tt (tid integer PRIMARY KEY) PARTITION BY LIST (tid); > CREATE TABLE ttp PARTITION OF tt DEFAULT; > CREATE TABLE st (sid integer); > MERGE INTO tt USING st ON tt.tid = st.sid WHEN NOT MATCHED THEN INSERT > VALUES (st.sid); Hmph. Yeah, I think that's just wrong: the cases of found-a-baserel and didn't-find-a-baserel should be treating MERGE-rejection identically. This is probably broken even before e9a20e451. Thanks for the report! regards, tom lane