Skip to content
pgdisablelogerror

pgdisablelogerror

pgdisablelogerror : Disable selected SQLSTATE error codes from PostgreSQL server logging.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
5260
pgdisablelogerror
pgdisablelogerror
1.0
ADMIN
PostgreSQL
C
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sLd-r
No
Yes
Yes
Yes
yes
no
Relationships
See Also
logerrors
pgauditlogtofile

PGDG RPM and Pigsty DEB package fmbiete/pgdisablelogerror 1.0; control is relocatable=true and requires shared_preload_libraries.

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
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 / PGPG18PG17PG16PG15PG14
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
PackageVersionOSORGSIZEFile URL
pgdisablelogerror_181.0el8.x86_64pgdg13.1 KiBpgdisablelogerror_18-1.0-1PGDG.rhel8.10.x86_64.rpm
pgdisablelogerror_181.0el8.aarch64pgdg13.1 KiBpgdisablelogerror_18-1.0-1PGDG.rhel8.10.aarch64.rpm
pgdisablelogerror_181.0el9.x86_64pgdg12.9 KiBpgdisablelogerror_18-1.0-1PGDG.rhel9.8.x86_64.rpm
pgdisablelogerror_181.0el9.x86_64pgdg12.9 KiBpgdisablelogerror_18-1.0-1PGDG.rhel9.7.x86_64.rpm
pgdisablelogerror_181.0el9.x86_64pgdg13.0 KiBpgdisablelogerror_18-1.0-1PGDG.rhel9.6.x86_64.rpm
pgdisablelogerror_181.0el9.aarch64pgdg12.8 KiBpgdisablelogerror_18-1.0-1PGDG.rhel9.8.aarch64.rpm
pgdisablelogerror_181.0el9.aarch64pgdg12.8 KiBpgdisablelogerror_18-1.0-1PGDG.rhel9.7.aarch64.rpm
pgdisablelogerror_181.0el9.aarch64pgdg12.9 KiBpgdisablelogerror_18-1.0-1PGDG.rhel9.6.aarch64.rpm
pgdisablelogerror_181.0el10.x86_64pgdg13.0 KiBpgdisablelogerror_18-1.0-1PGDG.rhel10.2.x86_64.rpm
pgdisablelogerror_181.0el10.x86_64pgdg13.0 KiBpgdisablelogerror_18-1.0-1PGDG.rhel10.1.x86_64.rpm
pgdisablelogerror_181.0el10.x86_64pgdg13.4 KiBpgdisablelogerror_18-1.0-1PGDG.rhel10.0.x86_64.rpm
pgdisablelogerror_181.0el10.aarch64pgdg13.0 KiBpgdisablelogerror_18-1.0-1PGDG.rhel10.2.aarch64.rpm
pgdisablelogerror_181.0el10.aarch64pgdg13.0 KiBpgdisablelogerror_18-1.0-1PGDG.rhel10.1.aarch64.rpm
pgdisablelogerror_181.0el10.aarch64pgdg13.0 KiBpgdisablelogerror_18-1.0-1PGDG.rhel10.0.aarch64.rpm
postgresql-18-pgdisablelogerror1.0d12.x86_64pigsty11.4 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-pgdisablelogerror1.0d12.aarch64pigsty11.5 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-pgdisablelogerror1.0d13.x86_64pigsty11.4 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~trixie_amd64.deb
postgresql-18-pgdisablelogerror1.0d13.aarch64pigsty11.6 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~trixie_arm64.deb
postgresql-18-pgdisablelogerror1.0u22.x86_64pigsty11.6 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~jammy_amd64.deb
postgresql-18-pgdisablelogerror1.0u22.aarch64pigsty11.5 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~jammy_arm64.deb
postgresql-18-pgdisablelogerror1.0u24.x86_64pigsty11.8 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~noble_amd64.deb
postgresql-18-pgdisablelogerror1.0u24.aarch64pigsty11.9 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~noble_arm64.deb
postgresql-18-pgdisablelogerror1.0u26.x86_64pigsty12.0 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~resolute_amd64.deb
postgresql-18-pgdisablelogerror1.0u26.aarch64pigsty12.1 KiBpostgresql-18-pgdisablelogerror_1.0-1PIGSTY~resolute_arm64.deb

Source

pig build pkg pgdisablelogerror;		# build rpm/deb

Install

Make sure PGDG repo available:

pig repo add pgdg -u    # add pgdg repo and update cache

Install this extension with pig:

pig install pgdisablelogerror;		# install via package name, for the active PG version

pig install pgdisablelogerror -v 18;   # install for PG 18
pig install pgdisablelogerror -v 17;   # install for PG 17
pig install pgdisablelogerror -v 16;   # install for PG 16
pig install pgdisablelogerror -v 15;   # install for PG 15
pig install pgdisablelogerror -v 14;   # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = '$libdir/pgdisablelogerror';

Create this extension with:

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.
Last updated on