Test Postgres policies through the role your application actually uses
Constructive’s pgsql-test harness runs tests against real Postgres databases, seeds fixtures once and rolls back each test’s changes. It separates administrative setup from the application client, letting tests exercise triggers, constraints and row-level security under the intended role. That distinction matters because a privileged test connection can bypass policies and make a broken authorization test appear successful.
Constructive via PostgreSQL · Sep 22, 2026
Why it matters
Useful when database behavior is important enough that mocks miss the failures you care about.
More context
Try the MIT-licensed harness with an existing test runner and Postgres instance. Its context helper sets transaction-local role and identity values; it does not authenticate tokens. Optional integrations include Drizzle, Supabase and PGlite, subject to their supported features.
Keep in mind
This is a third-party project announcement hosted by PostgreSQL, not a core PostgreSQL release. Published speed examples are not general guarantees; 1min has not run the harness.
Original read