From: Philippe Beaudoin <philippe.beaudoin@dalibo.com>
To: Petr Jelinek <petr.jelinek@2ndquadrant.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #14529: Missing non pk data for "before image" in logical decoding
Date: Mon, 6 Feb 2017 18:41:18 +0100
Message-ID: <2a8df43a-8023-6619-c043-7b0aa713ee46@dalibo.com> (raw)
In-Reply-To: <6f20b38c-13a2-2b22-04c2-88fd97d5c5e7@2ndquadrant.com>
References: <20170206161229.1409.73502@wrigleys.postgresql.org>
<6f20b38c-13a2-2b22-04c2-88fd97d5c5e7@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Le 06/02/2017 à 18:01, Petr Jelinek a écrit :
> 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().
>
Thank a lot, Petr, for your quick answer.
Effectively, the code you have pointed out is clear. And looking more
closely at the pgbench scenario and table structure confirms your
explanation.
The documentation doesn't explain this detail level. But as this output
plugin is only an example, I understand the documentation remains light.
Sorry for the trouble.
Philippe.
------------------------------------------------------------------------
<http://www.dalibo.com/;
*DALIBO*
*L'expertise PostgreSQL*
10 rue d'Uzès
75002 Paris *Philippe Beaudoin*
*Consultant Avant-Vente*
+33 (0)1 84 19 36 94
+33 (0)7 69 14 67 21
Attachments:iaebonkgopgmdnfj.png (image/png, 1.3K) downloadview image
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: philippe.beaudoin@dalibo.com, petr.jelinek@2ndquadrant.com
Subject: Re: BUG #14529: Missing non pk data for "before image" in logical decoding
In-Reply-To: <2a8df43a-8023-6619-c043-7b0aa713ee46@dalibo.com>
References: <20170206161229.1409.73502@wrigleys.postgresql.org> <6f20b38c-13a2-2b22-04c2-88fd97d5c5e7@2ndquadrant.com> <2a8df43a-8023-6619-c043-7b0aa713ee46@dalibo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox