Instant database clones with PostgreSQL 18

Postgres 18’s instant database copies have devs cheering — and cloud fans chiming in

TLDR: Postgres 18 enables near-instant database copies on modern file systems, making clean test runs and quick resets easy. Devs are thrilled for integration tests, while others note AWS Aurora has similar cloning, sparking a playful cloud-vs-DIY debate and a wave of tools and workflow tips.

Developers are losing it (in a good way) over Postgres 18’s new “instant clone” vibe — think copy your whole database in a snap, with almost no extra space, so tests can run clean every time. The article explains it simply: Postgres now lets you use modern file system tricks (like on APFS, ZFS, or XFS) to make near-instant copies. Translation: fewer late-night prayers over risky migrations, more “reset and rerun.” The integration-test crowd came in hot: one dev called it “game over” for flaky test setups, while another shouted that it “solves integration tests for us!” Meanwhile, a classic “well actually” arrived: an AWS fan dropped a link noting Aurora clones have done similar. Cue friendly cloud vs DIY banter — do you pay Amazon, or flex your own infra and keep it free? A power user also plugged a handy GUI tool for local Postgres testing, which got the usual mix of grateful stars and side-eye for promo. Bonus chatter: folks imagining spinning up multiple dev environments “like Gremlins after midnight,” and someone plotting seamless multi-project setups with git worktrees. The mood: excited, a little competitive, and very “tests go brrr.”

Key Points

  • PostgreSQL’s templating system allows cloning databases via CREATE DATABASE ... TEMPLATE, not just template1.
  • Pre-PostgreSQL 15 cloning required CHECKPOINT and caused I/O spikes; PostgreSQL 15 introduced STRATEGY with default WAL_LOG for smoother I/O.
  • WAL_LOG reduces latency and supports concurrency but can be slow for large templates; the STRATEGY parameter allows switching to FILE_COPY.
  • PostgreSQL 18 adds file_copy_method=clone, enabling instant, zero-copy clones on modern filesystems (ZFS, XFS with reflinks, APFS).
  • To use clone-based FILE_COPY, run PostgreSQL on a supported filesystem and set file_copy_method=clone, then reload; the article includes a ~6GB benchmark setup.

Hottest takes

"aws supports this as well" — 1f97
"solves integration tests for us!" — 1a527dd5
"useful when setting up git worktrees" — TimH
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.