pgstat: Prepare to use mechanism for truncated rels also for droppped rels.

Andres Freund <andres@anarazel.de>

Commit: 6b9501660c9384476ca9a04918f5cf94379e419e
Author: Andres Freund <andres@anarazel.de>
Date: 2021-09-20T21:02:48Z
Releases: 15.0
pgstat: Prepare to use mechanism for truncated rels also for droppped rels.

The upcoming shared memory stats patch drops stats for dropped objects in a
transactional manner, rather than removing them later as part of vacuum. This
means that stats for DROP inside a transaction needs to handle aborted
(sub-)transactions similar to TRUNCATE: The stats up to the DROP should be
restored.

Rename the existing infrastructure in preparation.

Author: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20210405092914.mmxqe7j56lsjfsej@alap3.anarazel.de

Files

PathChange+/−
src/backend/postmaster/pgstat.c modified +50 −43
src/include/pgstat.h modified +7 −5

Discussion