Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXx4u-0006fV-Ut for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2019 00:45:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iXx4t-0000Jf-FZ for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Nov 2019 00:45:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iXx4t-0000JX-4C for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2019 00:45:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iXx4q-0000iN-Pc for pgsql-bugs@lists.postgresql.org; Fri, 22 Nov 2019 00:45:37 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id xAM0jY5p016190; Thu, 21 Nov 2019 19:45:35 -0500 From: Tom Lane To: =?utf-8?Q?Ond=C5=99ej?= Jirman cc: Tomas Vondra , pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16129: Segfault in tts_virtual_materialize in logical replication worker In-reply-to: <20191122003626.ydgwvjfx363blgip@core.my.home> References: <20191121143503.nkdwgjwb7xjopeuq@development> <20191121150716.szxqukxrtpjpckm3@core.my.home> <20191121152732.hu6y4wzw7nkxpsvk@development> <20191121155707.pqkgjphh65o5fapz@core.my.home> <20191121161502.xfiy65i3cm6adscr@core.my.home> <20191121165752.dffge6bh756xlfdg@development> <20191121173555.midj6vp4dmiiqs24@core.my.home> <20191121185844.6qsqhwzzuhu3fpsg@core.my.home> <20191121214115.3tgefmvkmrzaim74@development> <20191121220854.ebdzjtloel56sfwu@development> <20191122003626.ydgwvjfx363blgip@core.my.home> Comments: In-reply-to =?utf-8?Q?Ond=C5=99ej?= Jirman message dated "Fri, 22 Nov 2019 01:36:26 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16188.1574383534.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 21 Nov 2019 19:45:34 -0500 Message-ID: <16189.1574383534@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =3D?utf-8?Q?Ond=3DC5=3D99ej?=3D Jirman write= s: > On Thu, Nov 21, 2019 at 11:08:54PM +0100, Tomas Vondra wrote: >> 1) Print newtup.values and newtup.changed matches, so that we can check >> it contains the tuple I shared before? There should be 8 elements in >> each, with 'values' being values formatted as text, and 'changed' being >> flags which values were updated. > newtup.changed > {true, true, false, true, true, true, true, true, false } So column 3 is not getting replaced. That seems to jibe with my theory that slot_modify_cstrings is failing to handle that case correctly. Can you try applying the patch I posted and see if it fixes the issue for you? regards, tom lane