Skip to content

Commit

Permalink
Fix toplevel calculation for older PG version
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Jun 11, 2024
1 parent 2675916 commit b0aa23f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pg_stat_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,11 @@ pgsm_create_hash_entry(uint64 bucket_id, uint64 queryid, PlanInfo * plan_info)
#if PG_VERSION_NUM < 140000
entry->key.toplevel = 1;
#else
#if PG_VERSION_NUM >= 170000
entry->key.toplevel = ((nesting_level) == 0);
#else
entry->key.toplevel = ((nesting_level + plan_nested_level) == 0);
#endif
#endif

if (IsTransactionState())
Expand Down

0 comments on commit b0aa23f

Please sign in to comment.