summaryrefslogtreecommitdiff
path: root/src/backend/utils/activity/pgstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/activity/pgstat.c')
-rw-r--r--src/backend/utils/activity/pgstat.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/backend/utils/activity/pgstat.c b/src/backend/utils/activity/pgstat.c
index ffb5b8cce34..f8e91484e36 100644
--- a/src/backend/utils/activity/pgstat.c
+++ b/src/backend/utils/activity/pgstat.c
@@ -1975,6 +1975,17 @@ pgstat_read_statsfile(void)
header = pgstat_init_entry(key.kind, p);
dshash_release_lock(pgStatLocal.shared_hash, p);
+ if (header == NULL)
+ {
+ /*
+ * It would be tempting to switch this ERROR to a
+ * WARNING, but it would mean that all the statistics
+ * are discarded when the environment fails on OOM.
+ */
+ elog(ERROR, "could not allocate entry %u/%u/%" PRIu64 " of type %c",
+ key.kind, key.dboid,
+ key.objid, t);
+ }
if (!read_chunk(fpin,
pgstat_get_entry_data(key.kind, header),