Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1camfS-0007I6-D2 for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Feb 2017 17:01:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1camfR-0002U7-V0 for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Feb 2017 17:01:29 +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.84_2) (envelope-from ) id 1camfQ-0002TS-W7 for pgsql-bugs@postgresql.org; Mon, 06 Feb 2017 17:01:29 +0000 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1camfN-0002s3-EI for pgsql-bugs@postgresql.org; Mon, 06 Feb 2017 17:01:28 +0000 Received: by mail-wm0-x234.google.com with SMTP id r141so121982002wmg.1 for ; Mon, 06 Feb 2017 09:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=6m1iNe9sYYc1tlfKNIAEQ9XYrvAclELDyDYvWj+f970=; b=FsenCC9QL/J3WUvFiiExt1s/xl8HRQxd0b/1LT72Hco/AMNzT5Pg2kPv/batpezx1i xr9ZTwzXTP2grtBsY61ToeRQ1G+gM+DeRG5SwQXWLxLqDt/Svzf3dnRp7GNToNOnAtPv KOG6ZU78asndVtQJPW4KhsS0iaP3eoWb78Vc1NEatqoJ2LbxHpx4InTu9msQEmLxobJk sksXmYECdrsaPvW0VnAfXs/ns7nGvpmSez/WnXF7imqJLb7qS31GZ11dSHtKmmynX+Th CHnsnn8dWGbzkNU89DDI4rsm0tGNIuG7ivH4Isd0yiurxN8EAJRIegdkpeLvHo/w4lQ9 Rb8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6m1iNe9sYYc1tlfKNIAEQ9XYrvAclELDyDYvWj+f970=; b=HYZUBfJaipDE90UfTIl2G0cjEtU5B9BEei2fr4SEIoUKyLgH4b2gEbbfXzP4C1jAKD sGGv5P2o7f6jPBM6X0qkQnDdhPB0wl8lQ7cpsvIcwCIvJj22U8A9+SmA9bS4XcjVzFeo l5kW78H+DH0vgdt+i5GvkQvgNacIToZEhuoWAnxYVMy0RLNzmNKCBTv2sz3PO2u2zQiB k5gYPoh1IfnfH0HMHtMvkuZxui/RCtwTwuAnzt2qVuLqDuCT8zbXuWQeuTHHXjn6DAt2 JBUndB1pg+PP3JjY5+ZOf1BUREajyvW5Rxv4gFiTlrdDKOlObHtT6u2BEVkuZf33JZJY oZhg== X-Gm-Message-State: AIkVDXLX7epNA8QjM8EI9M2Mjrt6D2ajF9c/Ba5vfLoRUpezlKtlHBGMcQAsHnP0AUOe6QOZupwtXW7Bx8a4hRalBRjubvz94ke8SaQjA4RDmR/t4szn0uFcUheGZtKuEIB9bsj/OL56bR503MIMFxE9BnQJA9II2BWzh6KVdmfx5ps04dhf4xtsOH9ImNj85tX1uAQN X-Received: by 10.223.136.206 with SMTP id g14mr9699052wrg.52.1486400480122; Mon, 06 Feb 2017 09:01:20 -0800 (PST) Received: from [192.168.43.221] (ip-37-188-238-11.eurotel.cz. [37.188.238.11]) by smtp.gmail.com with ESMTPSA id c133sm13886413wmd.13.2017.02.06.09.01.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Feb 2017 09:01:19 -0800 (PST) Subject: Re: BUG #14529: Missing non pk data for "before image" in logical decoding To: philippe.beaudoin@dalibo.com, pgsql-bugs@postgresql.org References: <20170206161229.1409.73502@wrigleys.postgresql.org> From: Petr Jelinek Message-ID: <6f20b38c-13a2-2b22-04c2-88fd97d5c5e7@2ndquadrant.com> Date: Mon, 6 Feb 2017 18:01:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170206161229.1409.73502@wrigleys.postgresql.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi, On 06/02/17 17:12, philippe.beaudoin@dalibo.com wrote: > The following bug has been logged on the website: > > Bug reference: 14529 > Logged by: Philippe BEAUDOIN > Email address: philippe.beaudoin@dalibo.com > PostgreSQL version: 9.6.1 > Operating system: Linux > Description: > > I am currently studying the logical decoding mechanism as an alternative to > log triggers for the E-Maj extension. > Using pg_recvlogical and pgbench, I have been able to reproduce an issue > that I met. > > [...snip...] > > BEGIN 5454770 > table public.pgbench_accounts: UPDATE: old-key: aid[integer]:24469 > bid[integer]:1 abalance[integer]:0 filler[character]:' > ' new-tuple: > aid[integer]:24469 bid[integer]:1 abalance[integer]:-3373 > filler[character]:' > ' > table public.pgbench_tellers: UPDATE: old-key: tid[integer]:2 bid[integer]:1 > tbalance[integer]:0 new-tuple: tid[integer]:2 bid[integer]:1 > tbalance[integer]:-3373 filler[character]:null > table public.pgbench_branches: UPDATE: old-key: bid[integer]:1 > bbalance[integer]:0 new-tuple: bid[integer]:1 bbalance[integer]:-3373 > filler[character]:null > table public.pgbench_history: INSERT: tid[integer]:2 bid[integer]:1 > aid[integer]:24469 delta[integer]:-3373 mtime[timestamp without time > zone]:'2017-01-21 09:51:29.728733' filler[character]:null > COMMIT 5454770 > BEGIN 5454771 > table public.pgbench_accounts: UPDATE: old-key: aid[integer]:4016 > bid[integer]:1 abalance[integer]:0 filler[character]:' > ' new-tuple: > aid[integer]:4016 bid[integer]:1 abalance[integer]:3308 filler[character]:' > > ' > table public.pgbench_tellers: UPDATE: old-key: tid[integer]:2 bid[integer]:1 > tbalance[integer]:-3373 new-tuple: tid[integer]:2 bid[integer]:1 > tbalance[integer]:-65 filler[character]:null > table public.pgbench_branches: UPDATE: old-key: bid[integer]:1 > bbalance[integer]:-3373 new-tuple: bid[integer]:1 bbalance[integer]:-65 > filler[character]:null > table public.pgbench_history: INSERT: tid[integer]:2 bid[integer]:1 > aid[integer]:4016 delta[integer]:3308 mtime[timestamp without time > zone]:'2017-01-21 09:51:29.74555' filler[character]:null > COMMIT 5454771 > #------------------------------------------------------------------------------- > > The incomplete UPDATEs concern pgbench_tellers and pgbench_branches > tables. > Seems to me like what you see here is not bug but just behavior of test_decoding plugin which skips NULL values from old-key printing - see the tuple_to_stringinfo() function and calls to it from pg_decode_change(). -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs