[HACKERS] Subscriber resets additional columns to NULL on UPDATE - Mailing list pgsql-hackers

From Petr Jelinek
Subject [HACKERS] Subscriber resets additional columns to NULL on UPDATE
Date
Msg-id 30f3b297-d1bb-5e90-38b0-6c0b98905506@2ndquadrant.com
Whole thread Raw
Responses Re: [HACKERS] Subscriber resets additional columns to NULL on UPDATE  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
Hi,

I found bug in logical replication where extra (nullable) columns on
subscriber will be reset to NULL value when update comes from provider.

The issue is apparently that we /points finger at himself/ forgot to
check specifically for columns that are not part of attribute map in
slot_modify_cstrings() so the extra columns will fall through to the
else block which sets the value to NULL.

Attached patch fixes it and adds couple of tests for this scenario.

This is rather serious issue so it would be good if we could get it
fixed in 10.1.

-- 
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Re: Is anything preventing us from allowing write toforeign tables from standby?
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least9.5)?