The intention of pg_branch is to optimize this process. They mention two problems:
1. The template database can't have active connections during the CREATE DATABASE process.
2. The CREATE DATABASE from a template database can be slow for large DBs.
1. The template database can't have active connections during the CREATE DATABASE process.
2. The CREATE DATABASE from a template database can be slow for large DBs.
Why would that be a problem ?
Regular tests shouldn’t assume access to staging/prod, anyway.