[Bucardo-general] Custom code

Joshua Tolley josh at endpoint.com
Wed Jun 16 20:17:04 UTC 2010

On Wed, Jun 16, 2010 at 05:10:26PM -0300, Rafael Pires Nakama wrote:
> Hi,
> May someone help me to understand how does the column src_code from
> customcode of the bucardo database works?
> Actually I'm trying to filter the sync, sending filtered rows to a
> slave. Like replicate only customers rows where city = 'Rio de Janeiro'
> to a slave rio_db.

You might be better off using customselect. See t/11-customselect.t for an
example of setting one up; essentially when you create the sync you say:

bucardo_ctl add sync foo usecustomselect=true ...

Then, in the bucardo database:

UPDATE goat SET customselect = $$SELECT * FROM table WHERE city = 'Rio de
Janeiro'$$ WHERE tablename = some_table

Josh Tolley  josh at endpoint.com  801-987-0252
End Point Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20100616/9fd34ce8/attachment.bin 

More information about the Bucardo-general mailing list