Merge pull request #315 from ibrarahmad/PG-306

PG-306: The bucket start time should be timestamp instead of TEXT.
pull/316/head
Naeem Akhter 2022-11-16 00:44:20 +05:00 committed by GitHub
commit 7f743b142a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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,

View File

@ -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

View File

@ -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 */