pgsql-test-exceptions
Installation
SKILL.md
Testing Exceptions and Aborted Transactions
Handle PostgreSQL's transaction abort behavior when testing operations that should fail. This is essential for security testing where you verify that unauthorized operations are rejected.
When to Apply
Use this skill when:
- Testing RLS policy violations (user can't access other users' data)
- Testing constraint violations (unique, foreign key, check)
- Testing permission denied errors
- Testing any operation that should throw an error
- Verifying database state after a failed operation
The Problem
When PostgreSQL encounters an error inside a transaction, it aborts the entire transaction. The connection rejects all further commands until you explicitly end the transaction: