errors
Structured PostgreSQL exceptions with JSON detail
errors · Structured PostgreSQL exceptions with JSON detail
Overview
| Relationships | |
|---|---|
| Requires | plpgsql |
Usage
Sources:
- packages/errors/README.md
- packages/errors/sql/errors–0.47.0.sql
- packages/errors/Makefile
- packages/errors/errors.control
errors supplies the single errors.raise_error helper. It raises SQLSTATE P0001 with a code in MESSAGE and a JSON object containing code, context and class in DETAIL.
Core Workflow
Operational Boundaries
The example intentionally raises an exception. The class is application metadata, not access control: callers and logs still receive the supplied context. Keep secrets out of error payloads.
Version 0.47.0 is a SQL/PLpgSQL extension with no own shared library or preload. Install the matching dependency versions first: plpgsql. The control permits non-superuser installation but is not marked trusted; dependency, schema and role-grant privileges still apply. No current PostgreSQL-major matrix is declared.