pgdisablelogerror
pgdisablelogerror : Disable selected SQLSTATE error codes from PostgreSQL server logging.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 5260 | pgdisablelogerror | pgdisablelogerror | 1.0 |
ADMIN | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sLd-r | No | Yes | Yes | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pg_stat_log pgelog logerrors pgaudit pg_sqlog log_fdw pg_auth_mon |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 1.0 |
18 17 16 15 14 | pgdisablelogerror |
- |
| RPM | PGDG | 1.0 |
18 17 16 15 14 | pgdisablelogerror_$v |
- |
| DEB | PIGSTY | 1.0 |
18 17 16 15 14 | postgresql-$v-pgdisablelogerror |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el8.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el9.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el9.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el10.x86_64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| el10.aarch64 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 | PGDG 1.0 |
| d12.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d12.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d13.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d13.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u22.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u22.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u24.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u24.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u26.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u26.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
Source
github.com/fmbiete/pgdisablelogerror
pgdisablelogerror-1.0.tar.gz
Install
Make sure PGDG repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
Create this extension with:
Usage
Sources: README, v1.0 release, control file
pgdisablelogerror suppresses PostgreSQL server log entries for configured SQLSTATE error codes. It is useful when expected application errors, such as duplicate-key violations, are too noisy in the server log.
Enable The Hook
Load the module and restart PostgreSQL:
Create the extension once in the postgres database:
Configure SQLSTATE Codes
Set pgdisablelogerror.sqlerrcode to a comma-separated list of SQLSTATE codes:
An empty or NULL value disables suppression:
To identify SQLSTATE values in normal PostgreSQL logs, add %e to log_line_prefix.
Caveats
- Version 1.0 supports PostgreSQL 14-18.
- This extension affects logging, not error behavior. Clients still receive the original error.
- Use narrow SQLSTATE lists. Suppressing broad error classes can hide real operational problems.