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 1opAd9-0006jb-AM for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Oct 2022 15:53:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1opAc9-0007BX-AF for pgsql-hackers@arkaria.postgresql.org; Sun, 30 Oct 2022 15:52:45 +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 1opAc8-0007BN-6d for pgsql-hackers@lists.postgresql.org; Sun, 30 Oct 2022 15:52:45 +0000 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opAbz-0005ts-FT for pgsql-hackers@lists.postgresql.org; Sun, 30 Oct 2022 15:52:43 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 705DF32004AE; Sun, 30 Oct 2022 11:52:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 30 Oct 2022 11:52:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1667145149; x=1667231549; bh=a rrSXGAMia8vI4L0181caL/bJRdJH+WXfV8zpOCpSoI=; b=Wx5T+93WXxAUbCp82 sepVv1YloGSR8i5xaeW33Y8enNYKmARQuxGUri5dRu1wHVYQEcOAahJ/KX/zEfZp zuyzDaTjjl8Xhi5dAmrjt5rAFxcHC/w9nhfRrFAFA0521EHw0LKWAQuS88y17o18 v1ttDjqg6ITzTB+RM5o+tqYXxT1Gi2zpJCXxk3l27kC6uLGpH9k8JGRUClcIjSRo o0wkDluv/q9CEcgy6SmVcJPOQSJCu+jiDBdWrW2EJFu1rd2HYEMT3y/HHcl8cxhD J0SHBtWThWgJx5/ryZrAtRbAanv4gH1ui8aQojgkQJiUnhF5dgBXEEydGImH1AAo 5hQDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedruddtgdekfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuffkgggtugfgjgesthekre dttddtjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgv segrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdektdffudfftd ffffehfffhjeejhffgieeuueekjeekfffgudffhfduffffueevnecuffhomhgrihhnpegv nhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 30 Oct 2022 11:52:29 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 64E147A; Sun, 30 Oct 2022 16:52:39 +0100 (CET) Date: Sun, 30 Oct 2022 16:52:39 +0100 From: Alvaro Herrera To: ilya.v.gladyshev@gmail.com Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Segfault on logical replication to partitioned table with foreign children Message-ID: <20221030155239.55zehfskzdppokox@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6b93e3748ba43298694f376ca8797279d7945e29.camel@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Oct-28, ilya.v.gladyshev@gmail.com wrote: > This will cause a segfault or raise an assert, because inserting into > foreign tables via logical replication is not possible. The solution I > propose is to add recursive checks of relkind for children of a target, > if the target is a partitioned table. However, I imagine that the only reason we don't support this is that the code hasn't been written yet. I think it would be better to write that code, so that we don't have to raise any error at all (unless the foreign table is something that doesn't support DML, in which case we would have to raise an error). Of course, we still have to fix it in backbranches, but we can just do it as a targeted check at the moment of insert/update, not at the moment of subscription create/alter. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "The eagle never lost so much time, as when he submitted to learn of the crow." (William Blake)