pgdisablelogerror
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgdisablelogerror | 1.0 | ADMIN | BSD | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 5260 | pgdisablelogerror | No | Yes | Yes | Yes | No | Yes | - |
| Related | logerrors pgauditlogtofile |
|---|
PGDG RPM and Pigsty DEB package fmbiete/pgdisablelogerror 1.0; control is relocatable=true and requires shared_preload_libraries.
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PGDG | 1.0 | 1817161514 | pgdisablelogerror | - |
| RPM | PGDG | 1.0 | 1817161514 | pgdisablelogerror_$v | - |
| DEB | PIGSTY | 1.0 | 1817161514 | postgresql-$v-pgdisablelogerror | - |
Build
You can build the RPM / DEB packages for pgdisablelogerror using pig build:
pig build pkg pgdisablelogerror # build RPM / DEB packages
Install
You can install pgdisablelogerror directly. First, make sure the PGDG repository is added and enabled:
pig repo add pgdg -u # Add PGDG repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pgdisablelogerror; # Install for current active PG version
pig ext install -y pgdisablelogerror -v 18 # PG 18
pig ext install -y pgdisablelogerror -v 17 # PG 17
pig ext install -y pgdisablelogerror -v 16 # PG 16
pig ext install -y pgdisablelogerror -v 15 # PG 15
pig ext install -y pgdisablelogerror -v 14 # PG 14
dnf install -y pgdisablelogerror_18 # PG 18
dnf install -y pgdisablelogerror_17 # PG 17
dnf install -y pgdisablelogerror_16 # PG 16
dnf install -y pgdisablelogerror_15 # PG 15
dnf install -y pgdisablelogerror_14 # PG 14
apt install -y postgresql-18-pgdisablelogerror # PG 18
apt install -y postgresql-17-pgdisablelogerror # PG 17
apt install -y postgresql-16-pgdisablelogerror # PG 16
apt install -y postgresql-15-pgdisablelogerror # PG 15
apt install -y postgresql-14-pgdisablelogerror # PG 14
Preload:
shared_preload_libraries = '$libdir/pgdisablelogerror';
Create Extension:
CREATE EXTENSION pgdisablelogerror;
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:
shared_preload_libraries = 'pgdisablelogerror'
Create the extension once in the postgres database:
CREATE EXTENSION pgdisablelogerror;
Configure SQLSTATE Codes
Set pgdisablelogerror.sqlerrcode to a comma-separated list of SQLSTATE codes:
pgdisablelogerror.sqlerrcode = '23505,23503'
An empty or NULL value disables suppression:
pgdisablelogerror.sqlerrcode = ''
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.
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.