Re: pglogical - logical replication contrib module - Mailing list pgsql-hackers

From Shulgin, Oleksandr
Subject Re: pglogical - logical replication contrib module
Date
Msg-id CACACo5T1s0Asr23ZXKONPcR+sT+yFztzAVSBqUW=22HhhOFpLg@mail.gmail.com
Whole thread Raw
In response to pglogical - logical replication contrib module  (Petr Jelinek <petr@2ndquadrant.com>)
Responses Re: pglogical - logical replication contrib module  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On Fri, Jan 1, 2016 at 12:34 AM, Petr Jelinek <petr@2ndquadrant.com> wrote:
Hi,

I'd like to submit the replication solution which is based on the pglogical_output [1] module (which is obviously needed for this to compile).

Hi,

Impressive stuff!

Apparently this depends on a newer, yet-to-be-published version of the pglogical_output patch:

.../contrib/pglogical/pglogical_hooks.c: In function ‘pglogical_row_filter_hook’:
.../contrib/pglogical/pglogical_hooks.c:173:35: error: ‘struct PGLogicalRowFilterArgs’ has no member named ‘change’
    HeapTuple  tup = &rowfilter_args->change->data.tp.newtuple->tuple;
                                   ^

It currently doesn't do multi-master or automatic DDL. I think DDL should be relatively easy if somebody finishes the deparse extension as the infrastructure for replicating arbitrary commands is present in this patch.

I wish could find the time to get back to this patch.  I didn't check it in quite a while...

+PGconn *
+pglogical_connect(const char *connstring, const char *connname)
+{
+ PGconn   *conn;
+ StringInfoData dsn;
+
+ initStringInfo(&dsn);
+ appendStringInfo(&dsn,
+ "%s fallback_application_name='%s'",
+ connstring, connname);
+
+ conn = PQconnectdb(dsn.data);

This is prone to errors when connstring is specified in URI format.  A workaround is provided in this commit for walreceiver: b3fc6727ce54a16ae9227bcccfebfa028ac5b16f

--
Alex

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Improved tab completion for FDW DDL
Next
From: "Shulgin, Oleksandr"
Date:
Subject: Re: custom function for converting human readable sizes to bytes