From 4fa5f747b00ee95c8fdffb81b3db9eee5aec32b0 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 2 Sep 2010 12:09:31 -0400 Subject: [PATCH] Force GMT timezone for better timestamptz comparisons. --- Bucardo.pm | 2 ++ bucardo.schema | 1 + 2 files changed, 3 insertions(+) diff --git a/Bucardo.pm b/Bucardo.pm index 89a4e3f34..af2831c46 100644 --- a/Bucardo.pm +++ b/Bucardo.pm @@ -4607,6 +4607,8 @@ sub start_kid { ## Note that all database handles are currently not in a txn (last action was commit or rollback) $sourcedbh->do('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE READ WRITE'); $targetdbh->do('SET TRANSACTION ISOLATION LEVEL SERIALIZABLE READ WRITE'); + $sourcedbh->do('SET TIME ZONE GMT'); + $targetdbh->do('SET TIME ZONE GMT'); ## We may want to lock all the tables ## TODO: alternate ways to trigger this diff --git a/bucardo.schema b/bucardo.schema index 0f880566d..cdb2ee5c3 100644 --- a/bucardo.schema +++ b/bucardo.schema @@ -1985,6 +1985,7 @@ $bc$ AS \$clone\$ BEGIN + SET TIME ZONE 'GMT'; IF (TG_OP = 'INSERT') THEN INSERT INTO bucardo.bucardo_delta(tablename,$rowids) VALUES (TG_RELID, $new); ELSIF (TG_OP = 'UPDATE') THEN -- 2.39.5