[Bucardo-general] Column order and foreign key

Greg Sabino Mullane greg at endpoint.com
Thu Mar 23 15:04:03 UTC 2017

On Thu, Mar 23, 2017 at 10:45:40AM +0100, Laurent GARCES wrote:
> bucardo update dbgroup shared shared_db_on_host1:source
> shared_db_on_host2:source shared_db_on_host3:source
> shared_db_on_host4:source
> The database schema is the same on all host. But the fields order on host4
> is different in some tables.

Hmm...that's interesting. I think Bucardo may indeed choke in that case, as 
we can handle *targets* with differing column orders, but not sources.
It's nt clear from a quick glance of the code where it is failing, as in 
theory we use a consistent $columnlist everywhere. I will dig into that.

Your quickest workaround is to rearrange those columns though.

>   - If yes, is there a way to force Bucardo to use column name instead of
> just using column order?

To be clear, it does use names.

> - How can Bucardo can bypass the foreign key constraint?

Bucardo sets session_replication_role, and thus ignores all triggers 
and rules (foreign keys are trigger based)

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/20170323/e96ed229/attachment.sig>

More information about the Bucardo-general mailing list