[Bucardo-general] selecting from view instead of underlying table for sync

Ali Asad Lotia ali at anobii.com
Tue May 8 15:20:46 UTC 2012


Hi All,
I'm wondering if it is possible to select from a view instead of the
underlying table/s for a configured synced table. My environment has
views that do several subselects and casts on fields in the underlying
tables to preferred values. I'm syncing from PostgreSQL 9.1 to MongoDB
2.0.4 and since there are no views in MongoDB I don't have the luxury
of creating views in the target DB. I'm wondering if it is possible to
do a custom select as outlined in t/20-mongo.t file in the the "#Test
of customselect options" section.

A more detailed example of what I'm trying to do in case the above
summary was too handwavy.

I have a postgresql table foo with columns foo_id (serial), name
(varchar(255), created_on(timestamp), modified_on(timestamp).
I have a postgresql view foo_view which is defined as SELECT foo_id AS
id, name, EXTRACT(EPOCH FROM created_on) AS creation_timestamp,
EXTRACT(EPOCH FROM modified_on) AS modification_timestamp


More information about the Bucardo-general mailing list