Re: pglogical cross subscribe

From: Andy Colson <andy(at)squeakycode(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pglogical cross subscribe
Date: 2016-08-11 15:51:14
Message-ID: 2867c347-ee8e-84a4-f5e2-9cd467e38c53@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message support-tiger 2016-08-11 17:04:37 Postgres Pain Points: 1 pg_hba conf
Previous Message Tom Lane 2016-08-11 13:45:52 Re: Jsonb extraction very slow