On 26/07/16 00:05, Hannu Krosing wrote:
CREATE PUBLICATION mypub;
ALTER PUBLICATION mypub ADD TABLE users, departments;
Would a subscription just be a logical grouping or would it be something
like meaning atomic subscriptions and/or a dedicated replication slot ?
Not sure what you mean by atomic subscription but subscription creation
adds replication slot to the provider node. Other than that subscription
lives on the downstream node only.
Can you subscribe to multiple publications through single SUBSCRIPTION ?
What is supposed to happen if table A is in two subscriptions S1 and S2,
subscribe to both? Will you get table a only once (both initial copy and
Yes only once, the replication works with tables, publication is really
just grouping/filtering, what you get is union of tables in the
Would a subscription of "mypub" pop up on subscriber side atomically, or
tables appear one-by one when they are ready (initial copy + catchup
event replay completed) ?
Yes that's my plan as that makes it easier to parallelize and recover
from crashes (also makes this faster as tables that are already done
don't need to be copied again) during the initialization. Also makes it
easier to reuse the table initialization code for adding new tables at
CREATE SUBSCRIPTION mysub WITH CONNECTION <quote>dbname=foo host=bar
user=repuser</quote> PUBLICATION mypub;
For the pgq-like version which consider a PUBLICATION just as list of
tables to subscribe, I would add
CREATE SUBSCRIPTION mysub WITH CONNECTION 'dbname=foo host=bar
user=repuser' PUBLICATION mypub, mypub1;
Yes that works as well.
ALTER SUBSCRIPTION mysub DROP PUBLICATION mypub1;
ALTER SUBSCRIPTION mysub ADD PUBLICATION mypub2;
This does not yet, but I agree we should have it.
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
Sent via pgsql-hackers mailing list (firstname.lastname@example.org)
To make changes to your subscription: