On 10/31/2016 06:38 AM, Petr Jelinek wrote:
There are some fundamental issues with initial sync that need to be discussed on list but this one is not known. I'll try to convert this to test case (seems like useful one) and fix it, thanks for the report. In meantime I realized I broke the last patch in the series during rebase so attached is the fixed version. It also contains the type info in the protocol.




I don't know if this is covered by the known initial_sync problems or not


If I have a 'all tables' publication and then create a new table the data doesn't seem to replicate to the new table.


P: create table a(a serial4 primary key, b text);
S: create table a(a serial4 primary key, b text);
P: create publication mypub for all tables;
S: create subscription mysub connection 'host=localhost dbname=test port=5441' publication mypub;
P: create table b(a serial4 primary key, b text);
P: insert into b(b) values ('foo2');
P: insert into a(b) values ('foo3');

Then I check my subscriber

select * FROM a;
 a |  b
---+------
 1 | foo
 2 | foo3
(2 rows)

test=# select * FROM b;
 a | b
---+---
(0 rows)


However, if the table isn't on the subscriber I do get an error:

ie

P: create table c(a serial4 primary key, b text);
P: insert into c(b) values('foo');

2016-11-05 11:49:31.456 EDT [14938] FATAL: the logical replication target public.c not found 2016-11-05 11:49:31.457 EDT [13703] LOG: worker process: logical replication worker 16457 (PID 14938) exited with exit code 1

but if then add the table
S: create table c(a serial4 primary key, b text);
2016-11-05 11:51:08.583 EDT [15014] LOG: logical replication apply for subscription mysub started

but the data doesn't replicate to table c either.




--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to