Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1epQIU-0002nx-Aq for pgsql-bugs@arkaria.postgresql.org; Sat, 24 Feb 2018 03:14:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epQIT-0000Dl-CR for pgsql-bugs@arkaria.postgresql.org; Sat, 24 Feb 2018 03:14:49 +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 1epQIS-0000DZ-TX for pgsql-bugs@lists.postgresql.org; Sat, 24 Feb 2018 03:14:49 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1epQIP-0001Wb-MQ for pgsql-bugs@lists.postgresql.org; Sat, 24 Feb 2018 03:14:47 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 29C9120D2A; Fri, 23 Feb 2018 22:14:44 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Fri, 23 Feb 2018 22:14:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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; s=fm2; bh=HNY7wu PL/DayyP2BBg87jh+u4CCXvVoEBLvvzKsQKiM=; b=dn+qzlwfetUKT3U2NCt8Tk xtwQN9xB1NbAYTtqiFShMYLeS8L66yGqqdUxc8qjI5uBKrbE18Ap37QkzkZ+h45Q WhFklwlQsLuU+1Ndjp+d/4pHUospLlTOzhu9UdHyzEjHvLlOp1pv+joffVf3Wlua KqMyNh/Yq1CN23JtqP5aMWpYU1iwIVzrV7oN9Bykq+o0GV0E3mOwN8h4r9YGmZ1q flpckMoZq04ozbIubMpVp0QuRUhlT8hEEph/Nzb9vbr2kk5OATF+98RLW9O3wU2O /f9RHKr9BL7MQPGb1cfxsOfBSXCZvka/zfBRU0FzbaOtZ3Rc56VFWoJuEVrqDG4A == X-ME-Sender: 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 C552F7E270; Fri, 23 Feb 2018 22:14:43 -0500 (EST) Subject: Re: BUG #15044: materialized views incompatibility with logical replication in postgres 10 From: Peter Eisentraut To: Petr Jelinek , Chad Trabant , "David G. Johnston" , pgsql-bugs@lists.postgresql.org References: <151753299917.1235.5710750500940066850@wrigleys.postgresql.org> <161542b1c98.27af.478e5036e088b5aaf247fa13bcb9f071@iris.washington.edu> <5754c88e-0ea5-ee34-5b4b-e50a6c66822f@2ndquadrant.com> <6e375316-91a4-7825-ef8b-9b8915ab6980@2ndquadrant.com> Organization: 2ndQuadrant Message-ID: Date: Fri, 23 Feb 2018 22:14:43 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <6e375316-91a4-7825-ef8b-9b8915ab6980@2ndquadrant.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/17/18 22:43, Peter Eisentraut wrote: > On 2/5/18 10:33, Petr Jelinek wrote: >>> Exactly.  The matview does not show up in pg_publication_tables but it's >>> registered at some level. >> >> Indeed this is a bug. For normal publications we take care of this when >> adding the relation to the publication but since ALL TABLES publications >> don't check for membership we have to filter this directly in the output >> plugin. > > I think the filtering in pgoutput ought to make use of > is_publishable_class() in some way. That takes care of non-tables such > as materialized views, but it also filters out the information_schema > tables for example. Right now, if you insert something into one of the > IS tables, it gets shipped over the wire but is then dropped by the > apply because there is no pg_subscription_rel entry of the table. That > doesn't quite have the user-visible effect as this bug, but it's bogus > nonetheless. > > So I propose this alternative patch that covers all these cases. Committed, and also added a new test in the master branch. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services