Skip to content

Commit

Permalink
Procedures have result type NULL
Browse files Browse the repository at this point in the history
Fix bigsql/plprofiler issue #8. Stored procedures do not
have a result type and the builtin pg_get_function_result()
returns NULL. Fallback to empty string fixes the issue.
  • Loading branch information
wieck committed Jun 2, 2022
1 parent 73691ee commit e9c08a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python-plprofiler/plprofiler/plprofiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ def get_local_report_data(self, opt_name, opt_top, func_oids):
FROM pl_profiler_callgraph_local()
GROUP BY func_oid)
SELECT P.oid, N.nspname, P.proname,
pg_catalog.pg_get_function_result(P.oid),
coalesce(pg_catalog.pg_get_function_result(P.oid), ''),
pg_catalog.pg_get_function_arguments(P.oid),
coalesce(SELF.us_self, 0) as self_time
FROM pg_catalog.pg_proc P
Expand Down Expand Up @@ -631,7 +631,7 @@ def get_shared_report_data(self, opt_name, opt_top, func_oids):
FROM pl_profiler_callgraph_shared()
GROUP BY func_oid)
SELECT P.oid, N.nspname, P.proname,
pg_catalog.pg_get_function_result(P.oid),
coalesce(pg_catalog.pg_get_function_result(P.oid), ''),
pg_catalog.pg_get_function_arguments(P.oid),
coalesce(SELF.us_self, 0) as self_time
FROM pg_catalog.pg_proc P
Expand Down

0 comments on commit e9c08a0

Please sign in to comment.