This template for HexFiend allows you to inspect PostgreSQL heap files.
This can be useful for doing post-mortem analysis of corrupted storage, exploring and teaching PostgreSQL internals.
You’ll need Hex Fiend 2.9.0 or later, however, this script is only tested with Hex Fiend 2.14.0.
Download the PostgreSQLHeap.tcl
Script and save it in ~/Library/Application Support/com.ridiculousfish.HexFiend/Templates
curl https://raw.githubusercontent.com/tbartelmess/PostgreSQL-Hexfiend/main/PostgreSQLHeap.tcl > ~/Library/Application\ Support/com.ridiculousfish.HexFiend/Templates
Open a PostgreSQL Heap file in HexFiend, open the “Binary Template” section (Views->Binary Templates) and select “PostgreSQL Heap”.