PG-260: Fix display of queries in pg_stat_monitor view.

Don't display queries in PARSE or PLAN state, to keep it consistent
with previous behavior, this avoids showing intermediate scripts like
part of a procedure, such as:
$1
$1 := $3
pull/120/head
Diego Fronza 2021-10-14 10:24:41 -03:00
parent 28b7559296
commit 0e06a4c701
1 changed files with 5 additions and 0 deletions

View File

@ -1712,6 +1712,11 @@ pg_stat_monitor_internal(FunctionCallInfo fcinfo,
if (tmp.state == PGSS_FINISHED) if (tmp.state == PGSS_FINISHED)
continue; continue;
} }
/* Skip queries such as, $1, $2 := $3, etc. */
if (tmp.state == PGSS_PARSE || tmp.state == PGSS_PLAN)
continue;
if (tmp.info.parentid != UINT64CONST(0)) if (tmp.info.parentid != UINT64CONST(0))
{ {
int len = 0; int len = 0;