Skip to main content

One post tagged with "pg_restore"

View All Tags

Dump/restore done. Now what?

· 15 min read
Nikolay Samokhvalov
CEO & Founder

Your pg_dump and pg_restore finished with exit code 0. Row counts match. The app connects. Now what?

Is the database ready for queries? Not yet. This post is about logical dump/restore with pg_dump and pg_restore. A physical restore, from pg_basebackup, WAL-G or pgBackRest, copies the data files as they are, so the statistics and the visibility map arrive with them. By default, a restore from a logical dump copies the rows but not the column statistics; on Postgres 18 and later, pg_dump --statistics can carry them. The visibility map is never copied: on the new server it starts empty. ANALYZE supplies missing planner statistics; --statistics can supply them from Postgres 18. VACUUM builds the visibility map. Postgres 19 reads can also set map bits, but that work then delays the first queries.