They way we did this was basically separate readonly and read/write tests. All the readonly tests would use the same instance with seeded data in parallel, and the read/write tests would get their own databases per test.
In my tests spinning up a PG instance (ultimately just an `initdb` and `createdb` invocation, loading a schema and test data (`psql`), running the test, and tearing down the PG instance is quite fast.
They way we did this was basically separate readonly and read/write tests. All the readonly tests would use the same instance with seeded data in parallel, and the read/write tests would get their own databases per test.
In my tests spinning up a PG instance (ultimately just an `initdb` and `createdb` invocation, loading a schema and test data (`psql`), running the test, and tearing down the PG instance is quite fast.