Instant database clones with PostgreSQL 18
boringsql.com·4d·
🗄️Database Internals
Preview
Report Post

Have you ever watched long running migration script, wondering if it’s about to wreck your data? Or wish you can "just" spin a fresh copy of database for each test run? Or wanted to have reproducible snapshots to reset between runs of your test suite, (and yes, because you are reading boringSQL) needed to reset the learning environment?

When your database is a few megabytes, pg_dump and restore works fine. But what happens when you’re dealing with hundreds of megabytes/gigabytes - or more? Suddenly "just make a copy" becomes a burden.

You’ve probably noticed that PostgreSQL connects to template1 by default. What you might have missed is that there’s a whole templating system hiding in plain sight. Every time you run

CREATE DATABASE dbname;

PostgreSQL quietly clo…

Similar Posts

Loading similar posts...