Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0UgS-0003hb-R1 for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Mar 2018 16:09:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f0UgR-00070i-MO for pgsql-bugs@arkaria.postgresql.org; Mon, 26 Mar 2018 16:09:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0UfK-0004Ch-Ok for pgsql-bugs@lists.postgresql.org; Mon, 26 Mar 2018 16:08:10 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f0UfF-00012i-Fy for pgsql-bugs@lists.postgresql.org; Mon, 26 Mar 2018 16:08:09 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id DA54311B8; Mon, 26 Mar 2018 12:08:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 26 Mar 2018 12:08:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=fL+ysKY8c4QomZ4zf R8RQzmyRGgJTps/K0P0JhLQPL0=; b=Pl+vKnxCAlI+Ond9Jy7XKnPsaANU79s9a 2ezbpnaMa/pQwZOtSjuw8xK1dlXPkg8F25x0XEllEGbrbtufUnnU24PgCk/gG18n a+jbl4h45z3H2NisVGMxDOQXQXP0/KqUk8M9jDDfbQzTQR6HsQwFgGGkmnf9c7Ue oUyyHuI0BDIWBlASp4R2FulcB/P3Tr0ote4Rn+8KYtfB36qeHdzftVERGWz8IJfy DhNYF+XMczB46lg4Us1b4bHJkNungskll9g4f/3cCtJBx+FTUBJeYC9iybAZhc1V KGljxT1lqcPARkwYbNTrEowsKGuX2b//7tZs/CjBHomMXtgZk46Hg== X-ME-Sender: Received: from alvin.alvh.no-ip.org (unknown [179.56.51.182]) by mail.messagingengine.com (Postfix) with ESMTPA id 1C85710259; Mon, 26 Mar 2018 12:08:03 -0400 (EDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 36E265A7; Mon, 26 Mar 2018 13:08:01 -0300 (-03) Date: Mon, 26 Mar 2018 13:08:01 -0300 From: Alvaro Herrera To: Andres Freund Cc: =?utf-8?B?0J/QtdGC0YrRgCDQodC70LDQstC+0LI=?= , Petr Jelinek , pgsql-bugs@lists.postgresql.org, Peter Eisentraut Subject: Re: BUG #15114: logical decoding Segmentation fault Message-ID: <20180326160801.ja4j43hwrc35iuhb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180326155237.i7qpurterx2iwg3c@alap3.anarazel.de> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund wrote: > Alvaro, Petr: If I understand correctly what happens here is that some > *other* column than the replica identity has a predicate with a full > blown SQL function. We shouldn't evaluate arbitrary code like that > inside the otuput plugin! > > So RelationGetIndexAttrBitmap() builds a bitmap of *all* indexed > columns. Besides the code exec problem above, this is also just > inefficient. I think this needs to be replaced by some replident > bespoke code? I agree -- I think logicalrep_write_attrs() should not use RelationGetIndexAttrBitmap at all but instead use some lower-level way to obtain columns of the replica identity. I don't know whether there are historical-snapshot-related considerations to care about, in this code, though. This is neither my area nor my code, but if Petr and Peter decline producing a patch for this quickly, I can look at it in a few days. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services