Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkYa8-0004k7-RN for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Aug 2017 16:32:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dkYa8-0006I6-E0 for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Aug 2017 16:32:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dkYZQ-0004xl-VF for pgsql-bugs@postgresql.org; Wed, 23 Aug 2017 16:31:57 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dkYZN-0004FI-W0 for pgsql-bugs@postgresql.org; Wed, 23 Aug 2017 16:31:55 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id E4FB720D21; Wed, 23 Aug 2017 12:31:52 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Wed, 23 Aug 2017 12:31:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=VJXqqAmnPK02fwbVR5 zmP+su0vPaomjO0CW5W9c4ufI=; b=AzuamfGNPRs4c6BTRXJYLigJC7glvT3Cww tuEfAwN/wFuFzWzaN9V5w85HDSTEJcbKMqEdJV0+bZ0hewmJpyk7U0POg2KsvWmC aXM/0XBHY8t/O/MNyRSkZ7eIdxgVDbqQ7JpgPboHbDFljD/WJlTSpzwH9T7Ob1uj LFdAhiEKdpneM+wZA3EI1f54VRua2XZ/9oOFfVh51zqhzxgO1UoCSp9fxHsXFNGf tyX3ZHUaXNhSUOehyMhX3b3KyWYhvGLX7LgxXYJzs5CXdoAxAVy+sk8b3qHnkq2A YBL9uRs1wPtt4nPEdQ9UxiH76kzs1Uu4OWPDAfnbvJpP2gOyOWSg== X-ME-Sender: X-Sasl-enc: QHeN3qc0j1IGoCttYmJrB0oUxDJNPmcbz5bk26P4h/MN 1503505912 Received: from intern.anarazel.de (unknown [136.24.76.72]) by mail.messagingengine.com (Postfix) with ESMTPA id A57FC24A95; Wed, 23 Aug 2017 12:31:52 -0400 (EDT) Date: Wed, 23 Aug 2017 09:31:51 -0700 From: Andres Freund To: Peter Eisentraut Cc: yxq@o2.pl, pgsql-bugs@postgresql.org Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug? Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com> 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 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