pg_errors is an extension to count statement errors that are not already tracked by core PostgreSQL. Currently only following conditions are tracked:
- statement_timeout
- statement cancel due to user request
- lock_timeout
- idle_in_transaction_timeout
This extension is compatible with PostgreSQL 10 and higher.
- Get latest
pg_errors
sources:
git clone https://github.com/pgtoolz/pg_errors
- Get latest PostgreSQL sources:
git clone https://github.com/postgres/postgres.git -b REL_16_STABLE && cd postgres
-
Compile and install PostgreSQL
-
Compile and install
pg_errors
extension
USE_PGXS=1 make -C /path/to/pg_errors/ install
- Configure extension
echo "shared_preload_libraries = 'pg_errors'" >> postgres_data/postgresql.conf
- Run PostgreSQL and create
pg_errors
extension
postgres=# CREATE EXTENSION pg_errors;
- pg_errors โ returns current statistics
- pg_errors_reset() โ reset statistics
Usually, you have to only install new version of pg_errors
, do ALTER EXTENSION 'pg_errors' UPDATE;
and restart PostgreSQL.
make check