Commit 6f40ee4f authored by Jeff Davis's avatar Jeff Davis

pg_stat_statements: add missing check for pgss_enabled().

Make pgss_post_parse_analyze() more consistent with the other hooks,
and avoid unnecessary overhead when pg_stat_statements.track=none.

Author: Raymond Martin
Reviewed-by: Fabien COELHO
Discussion: https://postgr.es/m/BN8PR21MB1217B003C4F79DE230AA36B9B1580%40BN8PR21MB1217.namprd21.prod.outlook.com
parent 42146686
...@@ -788,7 +788,7 @@ pgss_post_parse_analyze(ParseState *pstate, Query *query) ...@@ -788,7 +788,7 @@ pgss_post_parse_analyze(ParseState *pstate, Query *query)
Assert(query->queryId == UINT64CONST(0)); Assert(query->queryId == UINT64CONST(0));
/* Safety check... */ /* Safety check... */
if (!pgss || !pgss_hash) if (!pgss || !pgss_hash || !pgss_enabled())
return; return;
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment