PG-147 Stored Procedure Support add parentid to track caller.

Patch By: Martin Sun
Reviewed By: Hamid Akhtar
This commit is contained in:
Ibrar Ahmed
2021-02-12 11:42:36 +00:00
parent cba6bbfbd4
commit ed6fe2d8dc
8 changed files with 95 additions and 8 deletions

View File

@@ -31,6 +31,7 @@ CREATE FUNCTION pg_stat_monitor(IN showtext boolean,
OUT client_ip int8,
OUT queryid text,
OUT parentid text,
OUT query text,
OUT application_name text,
OUT relations text,
@@ -125,10 +126,12 @@ CREATE VIEW pg_stat_monitor AS SELECT
datname,
'0.0.0.0'::inet + client_ip AS client_ip,
queryid,
parentid,
query,
(SELECT query from pg_stat_monitor(true) s where s.queryid = p.parentid) AS parent_query,
application_name,
string_to_array(relations, ',') AS relations,
cmd_type,
cmd_type,
get_cmd_type(cmd_type) AS cmd_type_text,
elevel,
sqlcode,