BUG #15044: materialized views incompatibility with logical replication in postgres 10

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "chad(at)iris(dot)washington(dot)edu" <chad(at)iris(dot)washington(dot)edu>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: BUG #15044: materialized views incompatibility with logical replication in postgres 10
Date: 2018-02-02 01:16:04
Message-ID: CAKFQuwbXMMybbA-p11=P3D4Z0gbYq2hyDE1YV3JHRnu+UF3Abw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Thursday, February 1, 2018, PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

>
>
> Bug reference: 15044
>
> The built-in logical replication in postgres 10 is documented as not being
> able to replication materialized views, notably here:
> https://www.postgresql.org/docs/10/static/logical-replicatio
> n-restrictions.html
>
> Unfortunately, there appears to be an incompatibility with logical
> replication and materialized views.
>

[...]

> # Create publication and subscription
> psql -p 5433 -d postgres -c "CREATE PUBLICATION pub FOR ALL TABLES;"
>
> [...]

> # Create materialized view on publisher
> psql -p 5433 -d postgres -c "CREATE MATERIALIZED VIEW mvid AS SELECT id
> FROM
> testtable;"
>
> With that CREATE MATERIALIZED VIEW statement the replication broken, with
> these errors in the subscriber's log:
>
> 2018-02-01 16:34:27.639 PST [68409] ERROR: logical replication target
> relation "public.mvid" does not exist
>

It seems the work-around is to not use "for all tables" in your publication
definition.

As described it does seem bugged. The table matview itself is not being
published, as documented, but knowledge of its existence as part of the
publication is...

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Chad Trabant 2018-02-02 01:39:27 Re: BUG #15044: materialized views incompatibility with logical replication in postgres 10
Previous Message PG Bug reporting form 2018-02-02 00:56:39 BUG #15044: materialized views incompatibility with logical replication in postgres 10

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-02-02 01:35:40 Re: Cancelling parallel query leads to segfault
Previous Message Tatsuo Ishii 2018-02-02 01:09:35 Re: [HACKERS] [PATCH] Lockable views