Re: Feature Request - DDL deployment with logical replication

From: Chris Travers <chris(dot)travers(at)adjust(dot)com>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Feature Request - DDL deployment with logical replication
Date: 2018-03-30 07:38:44
Message-ID: CAN-RpxAbGR1msRMLhLq1EKdeHrUtHGC2MpSR+6MENskjTB9VWg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 30, 2018 at 9:26 AM, Konstantin Knizhnik <
k(dot)knizhnik(at)postgrespro(dot)ru> wrote:

>
>
> Our team in PostgresPro is also very interested in this discussion,
> because we are using logical decoding in multimaster.
> Right now in multimaster DDLs are replicated in this same way as in
> pglogical, using "logical messages" with correspondent DDL statements.
> There are a couple of problems related with this approach, for example mix
> of DDL with DML (create table as...) which we have addressed in multimaster.
>
> As an alternative we have considered possibility to replicate updates of
> catalog tables. In this case we need to address the following issues:
> 1. Map OIDs
> 2. Perform direct manipulation with files (i.e. truncate, alter table,...)
>

One very important note here is that since truncate is not replicated there
are cases where people are relying on current behaviour. For example, we
are going to use logical replication specifically for this reason as a way
of replacing our current FDW-based push approach. If truncate is ever
replicated, it would be really nice to be able to specify not to replicate
it on the subscription level.

> 3. Send invalidations
>
> Looks like it will be not so easy to implement this approach because we
> have to repeat or somehow reuse substantial part of executor code for this
> DDL nodes.
> And definitely this approach works only for Postgres-to-Postgres
> replication.
>
> So it will be very interesting for us to know roadmap for DDL support in
> logical replication.
>
>
> --
> Konstantin Knizhnik
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company
>
>
>

--
Best Regards,
Chris Travers
Database Administrator

Tel: +49 162 9037 210 | Skype: einhverfr | www.adjust.com
Saarbrücker Straße 37a, 10405 Berlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-03-30 07:43:35 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Previous Message Edmund Horner 2018-03-30 07:30:51 Re: pgbench doc typos