[Bucardo-general] patch for not setting NULL columns in mongo documents

Ali Asad Lotia ali at anobii.com
Mon Apr 30 13:55:27 UTC 2012

Hello All,

Please find attached a patch to have mongo not set columns that are NULL in
a PostgreSQL record to NULL in the corresponding document. Since Mongo is
schemaless, the general wisdom is to not have that property_name:
property_value combination in the document instead of setting it to NULL.
At present Bucardo.pm will print an error to the log indicating something

Use of uninitialized value in int at Bucardo.pm line 8530.

The attached patch prevents that error from occurring since it doesn't
attempt to coerce an unitialized value. If instead people want to insert a
NULL value where that column value is null, it may require a configuration
setting that allows you to choose between deleting and undefing that object

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20120430/d126c270/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mongo_delete_null_columns.patch
Type: application/octet-stream
Size: 929 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20120430/d126c270/attachment.obj>

More information about the Bucardo-general mailing list