mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 22:16:20 +00:00
PG-147: Stored Procedure Support add parentid to track caller.
Patch By: Martin Sun Reviewed By: Hamid Akhtar
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user