Skip to content

Comment on What if we treated Postgres like SQLite?

Comments

I don’t recall the mechanics but I do know that folks have bundled starting a local instance of PG solely for unit tests.

There’s a pre-install step to get PG on the machine, but once there, the testing framework stands it up, and shuts it down. As I recall it was pretty fast.

This is my version of it: https://pkg.go.dev/github.com/sapcc/go-bits/easypg#WithTestD...

The most annoying part of it is that Postgres absolutely detests running as PID 0, which makes running `make check` in Docker containers an unnecessarily frustrating experience. I understand why Postgres rejects PID 0 by default, but I would really like for them to recognize strcmp(getenv("I_AM_IN_DOCKER_AND_I_DONT_CARE"), "true") or something.

This is IMO best done running pg in a container using docker-compose or similar

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.