Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkVer-0001ux-Ix for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Aug 2017 13:25:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dkVer-0006ur-33 for pgsql-bugs@arkaria.postgresql.org; Wed, 23 Aug 2017 13:25:21 +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 1dkVep-0006q4-Bb for pgsql-bugs@postgresql.org; Wed, 23 Aug 2017 13:25:19 +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 1dkVem-0000If-0D for pgsql-bugs@postgresql.org; Wed, 23 Aug 2017 13:25:17 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 857B520CD2; Wed, 23 Aug 2017 09:25:14 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Wed, 23 Aug 2017 09:25:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=J8WBTtkKGzhnJQhYakg3O2/pskVzyoFTd4rk/V7bnDI=; b=Vk7V5qT6 9rVlGmiQlPUN4w2+IxrsF+NOoiVArF8DxTMvcuG6FeRHKlwKOYnS39GInDvRX5e6 Az4zmpmEBzROuHOq2uZCGwFymnCwlK3Uui3L7X4tkqEel7+wrytIFcrohl+wJait N5irfakQpkp52safCUb/oH3MX00hQbL/YzcM0Ih497SGU4LIiOkB54/83ajsZ2gg H+KUOybQTYdro+eI52t6icA5LgMGArMBAtNlocS7mW/k/UpwwlTMqSs4nXsXeMqZ B7MrPp+x10e7q3VPy8MKMB6PjJkLzv+j0R1JMUAYWwbzQpx+bHxX/OvrayzulwJL btZgJSWTWAdoiw== X-ME-Sender: X-Sasl-enc: F9HPA8Rtrd4Kl+IROLBniK6ZrfdEp6fXz/U5AoeKrItC 1503494714 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 3206C24871; Wed, 23 Aug 2017 09:25:14 -0400 (EDT) Subject: Re: BUG #14785: Logical replication does not work after adding a column. Bug? To: Andres Freund References: <20170820191720.1454.19868@wrigleys.postgresql.org> <14aeb673-fded-e9dd-9e90-f04908f9eadf@2ndquadrant.com> <20170822193418.drjntpluvcidfqyf@alap3.anarazel.de> Cc: yxq@o2.pl, pgsql-bugs@postgresql.org From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <4dfb4e26-9542-85d6-ff61-9e7080796b0e@2ndquadrant.com> Date: Wed, 23 Aug 2017 09:25:13 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170822193418.drjntpluvcidfqyf@alap3.anarazel.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 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? -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, 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