PostgreSQL file viewer
Drop a table's or an index's files from a PostgreSQL data directory to see its pages: line pointers, tuple headers with their MVCC fields, HOT chains, TOAST pointers, B-tree pivots and posting lists, the visibility map and the free space map.
Drop relation files here: a table, with its _vm, _fsm and TOAST files if you have them, or an index
Read in your browser, a page at a time. Nothing is uploaded.
Getting the files
Ask PostgreSQL where they are (relative to SHOW data_directory):
SELECT pg_relation_filepath('my_table'),
pg_relation_filepath(reltoastrelid)
FROM pg_class WHERE oid = 'my_table'::regclass;
CHECKPOINT; -- write recent changes to the filesCopy the file, and if you like the files beside it with the same number and _vm or _fsm after it, and the TOAST table's file. Drop them together. The data directory is readable only by the postgres user, so you may need sudo cp. A file copied while the server writes to it may have blocks that fail their checksums; the viewer says which.
Reads 8 KB-block relation files from PostgreSQL 8.3 and later (page layout version 4). Heap pages, B-tree indexes, the visibility map and the free space map are decoded; hash, GiST, SP-GiST, GIN and BRIN index pages and sequences are recognised and shown structurally. Values are decoded for the built-in types once the columns are given, including TOASTed values when the TOAST table is dropped too, and lz4- and pglz-compressed values. The parser is written from the PostgreSQL source and tested against pageinspect, pg_visibility and pg_freespacemap in PostgreSQL 19.0; it does not use PostgreSQL.