[Bucardo-general] coercing postgresql timestamp to mongo timestamps

Greg Sabino Mullane greg at endpoint.com
Thu May 3 22:12:48 UTC 2012


On Thu, May 03, 2012 at 07:27:58PM +0100, Ali Asad Lotia wrote:
> Hello All,
> Please find attached a patch that coerces PostgreSQL timestamps to
> MongoDB Date values. At present, timestamps are added to MongoDB as
> strings. If this patch is applied, running Bucardo with a MongoDB
> target will require the DateTime-Format-Pg module

I'd rather avoid another module requirement (as well as the 
overhead of actually using it) if it can be avoided. Would any of 
the existing date styles for Postgres work, e.g.:

greg=# SET datestyle='ISO';

greg=# SELECT a FROM abc LIMIT 1;

               a               
-------------------------------
 2012-04-09 13:36:43.175082-04

If not, we could also have Postgres change the output as part of 
the SELECT clause it does. Of course, this raises other issues 
if the timestamp will part of the primary key.

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20120503/4da3c57b/attachment.sig>


More information about the Bucardo-general mailing list