mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
Merge pull request #315 from ibrarahmad/PG-306
PG-306: The bucket start time should be timestamp instead of TEXT.
This commit is contained in:
@@ -30,7 +30,7 @@ CREATE FUNCTION pg_stat_monitor_internal(
|
|||||||
OUT elevel int,
|
OUT elevel int,
|
||||||
OUT sqlcode TEXT,
|
OUT sqlcode TEXT,
|
||||||
OUT message text,
|
OUT message text,
|
||||||
OUT bucket_start_time text,
|
OUT bucket_start_time timestamp,
|
||||||
|
|
||||||
OUT calls int8, -- 16
|
OUT calls int8, -- 16
|
||||||
|
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ CREATE FUNCTION pg_stat_monitor_internal(
|
|||||||
OUT elevel int,
|
OUT elevel int,
|
||||||
OUT sqlcode TEXT,
|
OUT sqlcode TEXT,
|
||||||
OUT message text,
|
OUT message text,
|
||||||
OUT bucket_start_time text,
|
OUT bucket_start_time timestamp,
|
||||||
|
|
||||||
OUT calls int8, -- 16
|
OUT calls int8, -- 16
|
||||||
|
|
||||||
@@ -190,7 +190,7 @@ $$
|
|||||||
BEGIN
|
BEGIN
|
||||||
CREATE VIEW pg_stat_monitor AS SELECT
|
CREATE VIEW pg_stat_monitor AS SELECT
|
||||||
bucket,
|
bucket,
|
||||||
bucket_start_time AS bucket_start_time,
|
bucket_start_time::text AS bucket_start_time,
|
||||||
userid::regrole,
|
userid::regrole,
|
||||||
datname,
|
datname,
|
||||||
'0.0.0.0'::inet + client_ip AS client_ip,
|
'0.0.0.0'::inet + client_ip AS client_ip,
|
||||||
@@ -247,7 +247,7 @@ $$
|
|||||||
BEGIN
|
BEGIN
|
||||||
CREATE VIEW pg_stat_monitor AS SELECT
|
CREATE VIEW pg_stat_monitor AS SELECT
|
||||||
bucket,
|
bucket,
|
||||||
bucket_start_time AS bucket_start_time,
|
bucket_start_time::text AS bucket_start_time,
|
||||||
userid::regrole,
|
userid::regrole,
|
||||||
datname,
|
datname,
|
||||||
'0.0.0.0'::inet + client_ip AS client_ip,
|
'0.0.0.0'::inet + client_ip AS client_ip,
|
||||||
@@ -307,7 +307,7 @@ $$
|
|||||||
BEGIN
|
BEGIN
|
||||||
CREATE VIEW pg_stat_monitor AS SELECT
|
CREATE VIEW pg_stat_monitor AS SELECT
|
||||||
bucket,
|
bucket,
|
||||||
bucket_start_time AS bucket_start_time,
|
bucket_start_time::text AS bucket_start_time,
|
||||||
userid::regrole,
|
userid::regrole,
|
||||||
datname,
|
datname,
|
||||||
'0.0.0.0'::inet + client_ip AS client_ip,
|
'0.0.0.0'::inet + client_ip AS client_ip,
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ CREATE FUNCTION pg_stat_monitor_internal(
|
|||||||
OUT elevel int,
|
OUT elevel int,
|
||||||
OUT sqlcode TEXT,
|
OUT sqlcode TEXT,
|
||||||
OUT message text,
|
OUT message text,
|
||||||
OUT bucket_start_time text,
|
OUT bucket_start_time timestamp,
|
||||||
|
|
||||||
OUT calls int8, -- 16
|
OUT calls int8, -- 16
|
||||||
|
|
||||||
|
|||||||
@@ -1845,7 +1845,7 @@ pg_stat_monitor_internal(FunctionCallInfo fcinfo,
|
|||||||
values[i++] = CStringGetTextDatum(tmp.error.message);
|
values[i++] = CStringGetTextDatum(tmp.error.message);
|
||||||
|
|
||||||
/* bucket_start_time at column number 15 */
|
/* 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)
|
if (tmp.calls.calls == 0)
|
||||||
{
|
{
|
||||||
/* Query of pg_stat_monitor itslef started from zero count */
|
/* Query of pg_stat_monitor itslef started from zero count */
|
||||||
|
|||||||
Reference in New Issue
Block a user