summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Davis2019-07-19 20:24:33 +0000
committerJeff Davis2019-07-19 20:38:55 +0000
commit6f40ee4f837ec1ac59c8ddc73b67a04978a184d5 (patch)
tree92f9e21840fbff113295dda431b388a699d56c0e
parent421466863548de58199c7c6ececaae6b5f621b2f (diff)
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
-rw-r--r--contrib/pg_stat_statements/pg_stat_statements.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c
index ba57628f6f2..221b47298ce 100644
--- a/contrib/pg_stat_statements/pg_stat_statements.c
+++ b/contrib/pg_stat_statements/pg_stat_statements.c
@@ -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;
/*