diff --git a/pg_stat_monitor--1.0--2.0.sql b/pg_stat_monitor--1.0--2.0.sql index dbfc8bb..5c2cbfa 100644 --- a/pg_stat_monitor--1.0--2.0.sql +++ b/pg_stat_monitor--1.0--2.0.sql @@ -30,7 +30,7 @@ CREATE FUNCTION pg_stat_monitor_internal( OUT elevel int, OUT sqlcode TEXT, OUT message text, - OUT bucket_start_time text, + OUT bucket_start_time timestamp, OUT calls int8, -- 16 diff --git a/pg_stat_monitor--1.0.sql b/pg_stat_monitor--1.0.sql index 0321479..186d29a 100644 --- a/pg_stat_monitor--1.0.sql +++ b/pg_stat_monitor--1.0.sql @@ -139,7 +139,7 @@ CREATE FUNCTION pg_stat_monitor_internal( OUT elevel int, OUT sqlcode TEXT, OUT message text, - OUT bucket_start_time text, + OUT bucket_start_time timestamp, OUT calls int8, -- 16 @@ -190,7 +190,7 @@ $$ BEGIN CREATE VIEW pg_stat_monitor AS SELECT bucket, - bucket_start_time AS bucket_start_time, + bucket_start_time::text AS bucket_start_time, userid::regrole, datname, '0.0.0.0'::inet + client_ip AS client_ip, @@ -247,7 +247,7 @@ $$ BEGIN CREATE VIEW pg_stat_monitor AS SELECT bucket, - bucket_start_time AS bucket_start_time, + bucket_start_time::text AS bucket_start_time, userid::regrole, datname, '0.0.0.0'::inet + client_ip AS client_ip, @@ -307,7 +307,7 @@ $$ BEGIN CREATE VIEW pg_stat_monitor AS SELECT bucket, - bucket_start_time AS bucket_start_time, + bucket_start_time::text AS bucket_start_time, userid::regrole, datname, '0.0.0.0'::inet + client_ip AS client_ip, diff --git a/pg_stat_monitor--2.0.sql b/pg_stat_monitor--2.0.sql index 339469a..1e87873 100644 --- a/pg_stat_monitor--2.0.sql +++ b/pg_stat_monitor--2.0.sql @@ -126,7 +126,7 @@ CREATE FUNCTION pg_stat_monitor_internal( OUT elevel int, OUT sqlcode TEXT, OUT message text, - OUT bucket_start_time text, + OUT bucket_start_time timestamp, OUT calls int8, -- 16 diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index 76cf180..6a22bdc 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -1845,7 +1845,7 @@ pg_stat_monitor_internal(FunctionCallInfo fcinfo, values[i++] = CStringGetTextDatum(tmp.error.message); /* bucket_start_time at column number 15 */ - values[i++] = CStringGetTextDatum(pgss->bucket_start_time[entry->key.bucket_id]); + values[i++] = CStringGetDatum(pgss->bucket_start_time[entry->key.bucket_id]); if (tmp.calls.calls == 0) { /* Query of pg_stat_monitor itslef started from zero count */