From e27dcc94a3e716b1c5dff34f30455a516ba794ac Mon Sep 17 00:00:00 2001 From: Steve Singer Date: Thu, 9 Jun 2011 17:02:21 -0400 Subject: [PATCH] Fix for bug 216. Pass the time to postgresql as seconds from EPOCH instead of as a timestamp with a timezone. MS-Windows does not generate the timezone as a 3 letter abbreviation but as a full word. This patch avoids the problem. --- src/slon/monitor_thread.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/slon/monitor_thread.c b/src/slon/monitor_thread.c index 3e6bb2d..bbf6400 100644 --- a/src/slon/monitor_thread.c +++ b/src/slon/monitor_thread.c @@ -163,8 +163,7 @@ monitorThread_main(void *dummy) { slon_appendquery(&monquery, "NULL::text, "); } - (void) strftime(timebuf, sizeof(timebuf), "%Y-%m-%d %H:%M:%S%z", localtime(&(state.start_time))); - slon_appendquery(&monquery, "'%s', ", timebuf); + slon_appendquery(&monquery, "'1970-01-01 0:0:0 UTC'::timestamptz + '%d seconds'::interval, ", time(NULL)); if (state.event > 0) { slon_appendquery(&monquery, "%L, ", state.event); -- 1.7.0.4