From 6f40ee4f837ec1ac59c8ddc73b67a04978a184d5 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Fri, 19 Jul 2019 13:24:33 -0700 Subject: [PATCH] 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 --- contrib/pg_stat_statements/pg_stat_statements.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index ba57628f6f..221b47298c 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; /* -- 2.40.0