postgres pg_filedump - ghdrako/doc_snipets GitHub Wiki

pg_filedump is a utility to format PostgreSQL heap/index/control files into a human-readable form.

Create test data:

CREATE TABLE test(id int, name text);
INSERT INTO test values(001, 'Aerith'), (002, 'Cloud'), (003, 'Tifa');

View file path:

SELECT pg_relation_filepath(β€˜test’);
pg_relation_filepath
β€”β€”β€”β€”β€”β€”β€”-
base/14236/164333

Using pg_filedump viewing files:

% pg_filedump $PGDATA/base/14236/164333

We can also use it to repair data, as mentioned in this slides β€” https://pgday.ru/presentation/146/59649714ee40a.pdf