{"slug": "pgtestdb", "name": "pgtestdb", "category": "dev-libs", "category_name": "Libraries and frameworks", "description": "", "recommenders": 3, "commenters": 3, "warners": 0, "score": 2.831, "rising": -0.98, "first": "2026-07-30", "latest": "2026-08-01", "why": "implementing simple apps and testing their execution with pgtestdb", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 3, "neutral": 0, "compare": 0, "warn": 0}, "spark": [0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0], "listed": true, "loved": [], "caveat": "", "short_quote": "implementing simple apps and testing their execution with pgtestdb", "kind": "", "icon": true, "domain": null, "github_repo": "github.com/peterldowns/pgtestdb", "official_url": "https://github.com/peterldowns/pgtestdb", "pricing": "", "aliases": ["pgtestdb"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 786185808, "item_id": 49136613, "url": "https://news.ycombinator.com/item?id=49136613", "by": "brandur", "date": "2026-08-01", "stance": "recommend", "quote": "a nice thing about it on disk", "excerpt": "Peter actually makes this exact point in the project's README. See this section here: https://github.com/peterldowns/pgtestdb#how-do-i-make-it-go-faster I'd just say that a nice thing about it on disk (even if you disable fsync) is that in case of a failing test, you can examine the post-run state which is occasionally extremely valuable.", "context": "", "use_case": "Postgres test DB cloning", "switched_from": "", "story": "Pgtestdb's template cloning approach to testing is fast"}, {"id": 785792928, "item_id": 49112058, "url": "https://news.ycombinator.com/item?id=49112058", "by": "lukasschwab", "date": "2026-07-30", "stance": "recommend", "quote": "implementing simple apps and testing their execution with pgtestdb", "excerpt": "> I\u2019m going to add a recommendation in our docs for pgtestdb, particularly for users aiming to test end-to-end (i.e. job inserted by client \u2192 fully completed by worker). That's exactly what I did to learn River \u2014 implementing simple apps and testing their execution with pgtestdb: https://github.com/lukasschwab/river-playground The starter skeleton was LLM-generated and not quite perfect, but discovering the coding ag", "context": "", "use_case": "Postgres test databases", "switched_from": "", "story": "Pgtestdb's template cloning approach to testing is fast"}]}], "caveats": [], "who": [], "tags": [], "use_cases": ["postgres test db cloning", "postgres test databases"], "compared": [{"slug": "postgresql", "name": "PostgreSQL", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [{"id": 741856033, "item_id": 46366002, "url": "https://news.ycombinator.com/item?id=46366002", "by": "peterldowns", "date": "2025-12-23", "stance": "recommend", "quote": "I have a golang project https://github.com/peterldowns/pgtestdb that uses templates to give you ~unit-test-speed integration tests", "excerpt": "Really interesting article, I didn't know that the template cloning strategy was configurable. Huge fan of template cloning in general; I've used Neon to do it for \"live\" integration environments, and I have a golang project https://github.com/peterldowns/pgtestdb that uses templates to give you ~unit-test-speed integration tests that each get their own fully-schema-migrated Postgres database. Back in the day (2013?)", "context": "", "use_case": "Fast per-test Postgres DBs in Go", "switched_from": "", "story": "Instant database clones with PostgreSQL 18"}], "threads": [{"url": "https://news.ycombinator.com/item?id=49135546", "title": "Pgtestdb's template cloning approach to testing is fast", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=49111687", "title": "Pgtestdb's template cloning approach to testing is fast", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=46363360", "title": "Instant database clones with PostgreSQL 18", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {}, "2026-01": {}, "2026-02": {}, "2026-03": {}, "2026-04": {}, "2026-05": {}, "2026-06": {}, "2026-07": {"recommend": 1}, "2026-08": {"recommend": 2}, "2026-09": {}, "2026-10": {}}, "quotes": [{"id": 786199712, "item_id": 49137482, "url": "https://news.ycombinator.com/item?id=49137482", "by": "stephen", "date": "2026-08-01", "stance": "recommend", "quote": "", "excerpt": "I haven't had time to try it, but I thought running PG on a copy-on-write filesystem with a specific \"clone template\" incantation would get you instant clones? Probably doable in a docker container? https://boringsql.com/posts/instant-database-clones/", "context": "", "use_case": "", "switched_from": "", "story": "Pgtestdb's template cloning approach to testing is fast"}, {"id": 786185808, "item_id": 49136613, "url": "https://news.ycombinator.com/item?id=49136613", "by": "brandur", "date": "2026-08-01", "stance": "recommend", "quote": "a nice thing about it on disk", "excerpt": "Peter actually makes this exact point in the project's README. See this section here: https://github.com/peterldowns/pgtestdb#how-do-i-make-it-go-faster I'd just say that a nice thing about it on disk (even if you disable fsync) is that in case of a failing test, you can examine the post-run state which is occasionally extremely valuable.", "context": "", "use_case": "Postgres test DB cloning", "switched_from": "", "story": "Pgtestdb's template cloning approach to testing is fast"}, {"id": 785792928, "item_id": 49112058, "url": "https://news.ycombinator.com/item?id=49112058", "by": "lukasschwab", "date": "2026-07-30", "stance": "recommend", "quote": "implementing simple apps and testing their execution with pgtestdb", "excerpt": "> I\u2019m going to add a recommendation in our docs for pgtestdb, particularly for users aiming to test end-to-end (i.e. job inserted by client \u2192 fully completed by worker). That's exactly what I did to learn River \u2014 implementing simple apps and testing their execution with pgtestdb: https://github.com/lukasschwab/river-playground The starter skeleton was LLM-generated and not quite perfect, but discovering the coding ag", "context": "", "use_case": "Postgres test databases", "switched_from": "", "story": "Pgtestdb's template cloning approach to testing is fast"}]}