Re: pglogical cross subscribe - Mailing list pgsql-general

From Andy Colson
Subject Re: pglogical cross subscribe
Date
Msg-id 2867c347-ee8e-84a4-f5e2-9cd467e38c53@squeakycode.net
Whole thread Raw
In response to pglogical cross subscribe  (Andy Colson <andy@squeakycode.net>)
Responses Re: pg_logical_slot_get_changes  (Andy Colson <andy@squeakycode.net>)
List pgsql-general
On 8/3/2016 8:27 PM, Andy Colson wrote:
> Hi all.
>
> I have a localdb and a remotedb.
>
> A) I'd like to send table1 and table2 from localdb to remotedb.
> B) I'd like to send table3 from remotedb to localdb.
>
> I have PG9.5 and pglogical setup, and (A) works fine.
>
> Well, worked.  I then tried to set up (B) which seems to work, but now
> (A) is broken.


Since pglogical wont work, I dropped part (B) and went back to just (A).

To implement part (B) I figured I could schedule a perl script to pull
changes.


On remote db I:
select pg_create_logical_replication_slot('custom_slot','decoder_raw');

And wrote myself a perl script to run in a cron job every hour that would:
SELECT * FROM pg_logical_slot_get_changes('custom_slot', null, null);

and send it to localdb.

Super.  Except pg_xlog grows and grows.  pg_replication_slots shows it
as active=false, and restart_lsn never changes.  Even after calling
pg_logical_slot_get_changes many times.

If I: select pg_drop_replication_slot('custom_slot');

pg_xlog shrinks right away.

Does that mean I cannot poll pg_logical_slot_get_changes()?  Do I have
to use something like pg_recvlogical or pglogical?


Thanks for your time,

-Andy


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Jsonb extraction very slow
Next
From: support-tiger
Date:
Subject: Postgres Pain Points: 1 pg_hba conf