[Bucardo-general] Miscellaneous number of rows with bucardo 5.4.1 logical replication in the table where there are child tables

Greg Sabino Mullane greg at endpoint.com
Mon May 22 15:29:40 UTC 2017


On Mon, May 22, 2017 at 11:14:53AM +0600, Пацев Антон wrote:
> Triggers:
>     bucardo_delta AFTER INSERT OR DELETE OR UPDATE ON table FOR EACH
> ROW EXECUTE PROCEDURE bucardo.delta_public_table()
...

> trigger_create_table_partition_and_insert_function BEFORE INSERT
> ON table FOR EACH ROW EXECUTE PROCEDURE
> create_table_partition_and_insert_function()
...
> На 9.3 
>  SELECT count(*) from table;
>  499401
> 
> На 9.5
> SELECT count(*) from table;
>  641335

If this means you are going *from* 9.3 *to* 9.5, then your partition 
trigger is not firing on 9.5 during the replication (which is the 
expected behavior - Bucardo disables all rules and triggers while 
copying data into a table.) To enable the partitioning on the remote 
databases, you will need to set the trigger to 'replica' (which means 
it will *only* happen during replication) or to 'always' (which means 
that it happens all the time). So try this on the 9.5 server:

ALTER TABLE mytable ENABLE ALWAYS TRIGGER trigger_create_table_partition_and_insert_function;

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 2529 DF6A B8F7 9407 E944  45B4 BC9B 9067 1496 4AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20170522/e203cac5/attachment.sig>


More information about the Bucardo-general mailing list