Pg freespacemap
lastmod 2020-04-17created 2020-04-172 edits
The pg_freespacemap module provides a way to examine the free space map (FSM). It provides the pg_freespace function, along with two overloaded functions that take different arguments under the same function name. The function returns the free space of a given page or table, row by row.
By default, the function can only be used by superusers because of security risks. (If needed, you can grant usage permission to specific users with the GRANT command.)