From 30441b69722d713474a04cd71d507c07ce0b902a Mon Sep 17 00:00:00 2001 From: Hamid Akhtar Date: Thu, 29 Dec 2022 14:45:17 +0500 Subject: [PATCH] PG-545: pg_stat_monitor: Same query text should generate same queryid Updating tap test case and upgrade SQL file from version 1.0 to 2.0. --- pg_stat_monitor--1.0--2.0.sql | 3 +++ t/018_column_names.pl | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pg_stat_monitor--1.0--2.0.sql b/pg_stat_monitor--1.0--2.0.sql index 29cdfa8..7143f58 100644 --- a/pg_stat_monitor--1.0--2.0.sql +++ b/pg_stat_monitor--1.0--2.0.sql @@ -101,6 +101,7 @@ CREATE VIEW pg_stat_monitor AS SELECT userid::regrole, datname, '0.0.0.0'::inet + client_ip AS client_ip, + pgsm_query_id, queryid, toplevel, top_queryid, @@ -155,6 +156,7 @@ CREATE VIEW pg_stat_monitor AS SELECT userid::regrole, datname, '0.0.0.0'::inet + client_ip AS client_ip, + pgsm_query_id, queryid, toplevel, top_queryid, @@ -216,6 +218,7 @@ CREATE VIEW pg_stat_monitor AS SELECT userid::regrole, datname, '0.0.0.0'::inet + client_ip AS client_ip, + pgsm_query_id, queryid, toplevel, top_queryid, diff --git a/t/018_column_names.pl b/t/018_column_names.pl index 0dd28bd..74ee049 100644 --- a/t/018_column_names.pl +++ b/t/018_column_names.pl @@ -31,7 +31,7 @@ my %pg_versions_pgsm_columns = ( 15 => "application_name,blk_read_time," . "jit_optimization_count,jit_optimization_time," . "local_blks_dirtied,local_blks_hit,local_blks_read," . "local_blks_written,max_exec_time,max_plan_time,mean_exec_time," . - "mean_plan_time,message,min_exec_time,min_plan_time,planid," . + "mean_plan_time,message,min_exec_time,min_plan_time,pgsm_query_id,planid," . "plans_calls,query,query_plan,queryid,relations,resp_calls," . "rows_retrieved,shared_blks_dirtied,shared_blks_hit,shared_blks_read," . "shared_blks_written,sqlcode,stddev_exec_time,stddev_plan_time," . @@ -43,7 +43,7 @@ my %pg_versions_pgsm_columns = ( 15 => "application_name,blk_read_time," . "client_ip,cmd_type,cmd_type_text,comments,cpu_sys_time,cpu_user_time," . "datname,elevel,local_blks_dirtied,local_blks_hit,local_blks_read," . "local_blks_written,max_exec_time,max_plan_time,mean_exec_time," . - "mean_plan_time,message,min_exec_time,min_plan_time,planid," . + "mean_plan_time,message,min_exec_time,min_plan_time,pgsm_query_id,planid," . "plans_calls,query,query_plan,queryid,relations,resp_calls," . "rows_retrieved,shared_blks_dirtied,shared_blks_hit,shared_blks_read," . "shared_blks_written,sqlcode,stddev_exec_time,stddev_plan_time," . @@ -54,7 +54,7 @@ my %pg_versions_pgsm_columns = ( 15 => "application_name,blk_read_time," . "client_ip,cmd_type,cmd_type_text,comments,cpu_sys_time,cpu_user_time," . "datname,elevel,local_blks_dirtied,local_blks_hit,local_blks_read," . "local_blks_written,max_exec_time,max_plan_time,mean_exec_time," . - "mean_plan_time,message,min_exec_time,min_plan_time,planid," . + "mean_plan_time,message,min_exec_time,min_plan_time,pgsm_query_id,planid," . "plans_calls,query,query_plan,queryid,relations,resp_calls," . "rows_retrieved,shared_blks_dirtied,shared_blks_hit,shared_blks_read," . "shared_blks_written,sqlcode,stddev_exec_time,stddev_plan_time," . @@ -64,7 +64,7 @@ my %pg_versions_pgsm_columns = ( 15 => "application_name,blk_read_time," . "bucket_start_time,calls,client_ip,cmd_type,cmd_type_text,comments," . "cpu_sys_time,cpu_user_time,datname,elevel,local_blks_dirtied," . "local_blks_hit,local_blks_read,local_blks_written,max_time,mean_time," . - "message,min_time,planid,query,query_plan,queryid,relations,resp_calls," . + "message,min_time,pgsm_query_id,planid,query,query_plan,queryid,relations,resp_calls," . "rows_retrieved,shared_blks_dirtied,shared_blks_hit,shared_blks_read," . "shared_blks_written,sqlcode,stddev_time,temp_blks_read,temp_blks_written," . "top_query,top_queryid,total_time,userid"