commit b975d7c2fe1b36a3ded1e0960be191466704e0fc Author: Satoshi Nagayasu Date: Sat Aug 8 08:51:45 2015 +0000 Fix pg_stat_statements to avoid assert failure when queryId already has non-zero value. diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statements.c index 59b8a2e..84c5200 100644 --- a/contrib/pg_stat_statements/pg_stat_statements.c +++ b/contrib/pg_stat_statements/pg_stat_statements.c @@ -776,8 +776,9 @@ pgss_post_parse_analyze(ParseState *pstate, Query *query) if (prev_post_parse_analyze_hook) prev_post_parse_analyze_hook(pstate, query); - /* Assert we didn't do this already */ - Assert(query->queryId == 0); + /* Assume that other module has calculated and set queryId */ + if (query->queryId > 0) + return; /* Safety check... */ if (!pgss || !pgss_hash)