Advanced testing with Injection Points
summary
PostgreSQL 17 adds injection points as a developer testing toolkit built into core (enabled at configure time) with two API files injection_point.c/injection_point.h and a shared‑memory array plus a per‑process cache for loaded points. Tests load callbacks from libraries, use a small test extension that provides SQL functions to attach/detach, wait/wake, set_local, and now supports runtime arguments and cached points so callbacks run inside critical sections safely. Used in CI, it reproduces race conditions (Noah’s isolation test with ~10–20 permutations), fixes reindex and checkpoint races, and stabilizes standby logical decoding tests.
AI-written summary · about
chapters (5)
- 0:00Introduction and motivation
- 13:22Core implementation details
- 23:39Test facilities and SQL functions
- 33:57Practical examples and use cases
- 49:00Q&A and future plans








