pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: yxq@o2.pl
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug?
Date: Wed, 23 Aug 2017 09:31:51 -0700
Message-ID: <20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de> (raw)
In-Reply-To: <4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com>
References: <20170820191720.1454.19868@wrigleys.postgresql.org>
	<14aeb673-fded-e9dd-9e90-f04908f9eadf@2ndquadrant.com>
	<20170822193418.drjntpluvcidfqyf@alap3.anarazel.de>
	<4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2017-08-23 09:25:13 -0400, Peter Eisentraut wrote:
> On 8/22/17 15:34, Andres Freund wrote:
> > On 2017-08-22 15:22:41 -0400, Peter Eisentraut wrote:
> >> When you add a column on the publication side, you also need to add it
> >> on the subscription side, otherwise there is nowhere to put the data.
> > 
> > Op's sql shows that that's done. The problem is the table rewrite not
> > being handled nicely by logical decoding / replication.
> 
> OK, I see it now.
> 
> The problem happens on the publisher side.  After the table rewrite on
> the publisher side, the output plugin starts sending the wrong relname.
> 
> The name comes straight from RelationGetRelationName() (in
> logicalrep_write_rel()) with the Relation that gets passed into the
> pgoutput_change() callback, so there doesn't appear to be an obvious
> logic error in the output plugin.
> 
> Any ideas?  Do we need to renew a snapshot somehow, perhaps?

This is "known" behaviour - this is the actual data WAL logged :(. Table
rewrites generate these pg_temp* tables and log the data there...

Greetings,

Andres Freund


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



view thread (20+ messages)  latest in thread

Message-ID: <20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de>
Permalink:  ../20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de

 · 

reply

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: andres@anarazel.de, peter.eisentraut@2ndquadrant.com, yxq@o2.pl
  Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug?
  In-Reply-To: <20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de>
  References: <20170820191720.1454.19868@wrigleys.postgresql.org> <14aeb673-fded-e9dd-9e90-f04908f9eadf@2ndquadrant.com> <20170822193418.drjntpluvcidfqyf@alap3.anarazel.de> <4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com> <20170823163151.5dankkw7z72ltmvw@alap3.anarazel.de>

* 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