Re: BUG #15044: materialized views incompatibility with logicalreplication in postgres 10 - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: BUG #15044: materialized views incompatibility with logicalreplication in postgres 10
Date
Msg-id CAKFQuwZgKScYL=prxnXFL827eF+e-4DxUi6vAO=VzUj=_eFs0A@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Adding -hackers to this in the interest of getting it committed by Monday's wrap-up.


David J.

On Sat, Feb 17, 2018 at 8:43 PM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> 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.

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: parallel append vs. simple UNION ALL
Next
From: Thomas Munro
Date:
Subject: Re: Treating work_mem as a shared resource (Was: Parallel Hash take II)