Re: Proposal: Generic WAL logical messages - Mailing list pgsql-hackers

From Artur Zakirov
Subject Re: Proposal: Generic WAL logical messages
Date
Msg-id 56EBF655.6080407@postgrespro.ru
Whole thread Raw
In response to Re: Proposal: Generic WAL logical messages  (Craig Ringer <craig@2ndquadrant.com>)
Responses Re: Proposal: Generic WAL logical messages  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On 17.03.2016 15:42, Craig Ringer wrote:
>
>
> Would you mind sharing the plugin here? I could add it to
> src/test/modules and add some t/ tests so it runs under the TAP test
> framework.
>
>
> --
>   Craig Ringer http://www.2ndQuadrant.com/
>   PostgreSQL Development, 24x7 Support, Training & Services

Of course. I attached it.

In a provider node you need to set shared_preload_libraries to
'pg_ddl_decode'.

In a subscriber node you need:
1 - install pg_ddl_decode by the command:

CREATE EXTENSION pg_ddl_decode;

2 - call the function:

SELECT ddl_create_slot('host=providerhost port=5432 dbname=db');

3 - after some DDL queries in provider you need to execute in a
subscriber the command manually:

SELECT ddl_get_changes('host=providerhost port=5432 dbname=db');


I warn that this plugin has ugly code sometimes. And ddl_get_changes()
has a infinite loop. But it shows concept of DDL replication.

Also this plugin uses some functions from pglogical_output and pglogical.


Earlier I have did tests with pglogical. I attached the patch for pglogical.

--
Artur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: GinPageIs* don't actually return a boolean
Next
From: David Steele
Date:
Subject: Re: eXtensible Transaction Manager API (v2)