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

From Craig Ringer
Subject Re: pglogical - logical replication contrib module
Date
Msg-id CAMsr+YH-=kpPBEHoMsgS2nGtyWpXhSb=kv4dzK5vpUHdL-3Z+A@mail.gmail.com
Whole thread Raw
In response to Re: pglogical - logical replication contrib module  ("Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>)
Responses Re: pglogical - logical replication contrib module  (Craig Ringer <craig@2ndquadrant.com>)
List pgsql-hackers
On 5 January 2016 at 00:46, Shulgin, Oleksandr <oleksandr.shulgin@zalando.de> wrote:
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;

Good point. Looks like I forgot to push. Done now:




I hadn't posted the rev to -hackers yet because I still have to finish SGMLifying the docs before it can be a real candidate for inclusion. The current docs have drifted a little as a result of that WIP. I'm not really working for another week and a half though, so I might as well post the current status as-is.

Still have to finish the docs conversion but that's the only remaining open item.

Note that this patch has 9.4 support. I'd be pretty happy to be able to retain that, mostly to avoid the need to carry a backported version as a separately packaged extension, but I'm not sure what the general opinion will be on that.
 
+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


Thanks for the heads-up there.

 -- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
Attachment

pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: Add numeric_trim(numeric)
Next
From: Kyotaro HORIGUCHI
Date:
Subject: Re: pgbench - allow backslash-continuations in custom scripts