Fixes Don't attempt to get a transaction ID when in hot standby mode
@@ -925,6 +925,9 @@ get_query_state(Query *query)
ctl.entrysize = sizeof(QueryState);
ctl.hcxt = TopMemoryContext;
query_cache = hash_create("query_cache", 16, &ctl, HASH_ELEM | HASH_BLOBS | HASH_CONTEXT);
+ query_cache_xid = InvalidTransactionId;
+
+ if (!RecoveryInProgress())
query_cache_xid = GetCurrentTransactionId();
}
