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
This commit is contained in:
Jeff Davis 2019-07-19 13:24:33 -07:00
parent 4214668635
commit 6f40ee4f83
1 changed files with 1 additions and 1 deletions

View File

@ -788,7 +788,7 @@ pgss_post_parse_analyze(ParseState *pstate, Query *query)
Assert(query->queryId == UINT64CONST(0));
/* Safety check... */
if (!pgss || !pgss_hash)
if (!pgss || !pgss_hash || !pgss_enabled())
return;
/*