Skip to content

pg_auth_mon

monitor connection attempts per user

pg_auth_mon : monitor connection attempts per user

Overview

ID Extension Package Version Category License Language
7150 pg_auth_mon pg_auth_mon 5.0 SEC MIT C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--sLd-r No Yes Yes Yes yes no
SQL 1.1; preload.

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT MIXED 5.0 19 18 17 16 15 pg_auth_mon -
RPM PGDG 5.0 19 18 17 16 15 pg_auth_mon_$v -
DEB PIGSTY 5.0 19 18 17 16 15 postgresql-$v-pg-auth-mon -
Linux / PG PG19 PG18 PG17 PG16 PG15
el8.x86_64 N/A PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0
el8.aarch64 N/A PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0
el9.x86_64 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0
el9.aarch64 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0
el10.x86_64 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0
el10.aarch64 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0 PGDG 5.0
d12.x86_64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
d12.aarch64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
d13.x86_64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
d13.aarch64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
u22.x86_64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
u22.aarch64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
u24.x86_64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
u24.aarch64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
u26.x86_64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
u26.aarch64 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0 PIGSTY 5.0
Package Version OS ORG SIZE File URL
pg_auth_mon_19 5.0 el9.x86_64 pgdg 17.8 KiB pg_auth_mon_19-5.0-5PGDG.rhel9.9.x86_64.rpm
pg_auth_mon_19 5.0 el9.aarch64 pgdg 17.7 KiB pg_auth_mon_19-5.0-5PGDG.rhel9.9.aarch64.rpm
pg_auth_mon_19 5.0 el10.x86_64 pgdg 17.8 KiB pg_auth_mon_19-5.0-5PGDG.rhel10.3.x86_64.rpm
pg_auth_mon_19 5.0 el10.aarch64 pgdg 18.0 KiB pg_auth_mon_19-5.0-5PGDG.rhel10.3.aarch64.rpm
postgresql-19-pg-auth-mon 5.0 d12.x86_64 pigsty 16.7 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~bookworm_amd64.deb
postgresql-19-pg-auth-mon 5.0 d12.aarch64 pigsty 17.0 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~bookworm_arm64.deb
postgresql-19-pg-auth-mon 5.0 d13.x86_64 pigsty 16.7 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~trixie_amd64.deb
postgresql-19-pg-auth-mon 5.0 d13.aarch64 pigsty 17.0 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~trixie_arm64.deb
postgresql-19-pg-auth-mon 5.0 u22.x86_64 pigsty 17.8 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~jammy_amd64.deb
postgresql-19-pg-auth-mon 5.0 u22.aarch64 pigsty 17.7 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~jammy_arm64.deb
postgresql-19-pg-auth-mon 5.0 u24.x86_64 pigsty 17.5 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~noble_amd64.deb
postgresql-19-pg-auth-mon 5.0 u24.aarch64 pigsty 17.6 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~noble_arm64.deb
postgresql-19-pg-auth-mon 5.0 u26.x86_64 pigsty 17.5 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~resolute_amd64.deb
postgresql-19-pg-auth-mon 5.0 u26.aarch64 pigsty 17.5 KiB postgresql-19-pg-auth-mon_5.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_auth_mon_18 5.0 el8.x86_64 pgdg 18.3 KiB pg_auth_mon_18-5.0-5PGDG.rhel8.10.x86_64.rpm
pg_auth_mon_18 3.0 el8.x86_64 pgdg 16.9 KiB pg_auth_mon_18-3.0-3PGDG.rhel8.x86_64.rpm
pg_auth_mon_18 5.0 el8.aarch64 pgdg 18.3 KiB pg_auth_mon_18-5.0-5PGDG.rhel8.10.aarch64.rpm
pg_auth_mon_18 3.0 el8.aarch64 pgdg 17.0 KiB pg_auth_mon_18-3.0-3PGDG.rhel8.aarch64.rpm
pg_auth_mon_18 5.0 el9.x86_64 pgdg 17.8 KiB pg_auth_mon_18-5.0-5PGDG.rhel9.9.x86_64.rpm
pg_auth_mon_18 5.0 el9.aarch64 pgdg 17.7 KiB pg_auth_mon_18-5.0-5PGDG.rhel9.9.aarch64.rpm
pg_auth_mon_18 5.0 el10.x86_64 pgdg 17.8 KiB pg_auth_mon_18-5.0-5PGDG.rhel10.3.x86_64.rpm
pg_auth_mon_18 5.0 el10.aarch64 pgdg 18.0 KiB pg_auth_mon_18-5.0-5PGDG.rhel10.3.aarch64.rpm
pg_auth_mon_18 5.0 el10.aarch64 pgdg 18.0 KiB pg_auth_mon_18-5.0-5PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_18 3.0 el10.aarch64 pgdg 17.2 KiB pg_auth_mon_18-3.0-6PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_18 3.0 el10.aarch64 pgdg 17.4 KiB pg_auth_mon_18-3.0-3PGDG.rhel10.aarch64.rpm
postgresql-18-pg-auth-mon 5.0 d12.x86_64 pigsty 16.7 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~bookworm_amd64.deb
postgresql-18-pg-auth-mon 5.0 d12.aarch64 pigsty 17.0 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~bookworm_arm64.deb
postgresql-18-pg-auth-mon 5.0 d13.x86_64 pigsty 16.7 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~trixie_amd64.deb
postgresql-18-pg-auth-mon 5.0 d13.aarch64 pigsty 17.0 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~trixie_arm64.deb
postgresql-18-pg-auth-mon 5.0 u22.x86_64 pigsty 17.9 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~jammy_amd64.deb
postgresql-18-pg-auth-mon 5.0 u22.aarch64 pigsty 17.8 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~jammy_arm64.deb
postgresql-18-pg-auth-mon 5.0 u24.x86_64 pigsty 17.6 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~noble_amd64.deb
postgresql-18-pg-auth-mon 5.0 u24.aarch64 pigsty 17.7 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~noble_arm64.deb
postgresql-18-pg-auth-mon 5.0 u26.x86_64 pigsty 17.5 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~resolute_amd64.deb
postgresql-18-pg-auth-mon 5.0 u26.aarch64 pigsty 17.5 KiB postgresql-18-pg-auth-mon_5.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_auth_mon_17 5.0 el8.x86_64 pgdg 18.3 KiB pg_auth_mon_17-5.0-5PGDG.rhel8.10.x86_64.rpm
pg_auth_mon_17 3.0 el8.x86_64 pgdg 16.6 KiB pg_auth_mon_17-3.0-1PGDG.rhel8.x86_64.rpm
pg_auth_mon_17 5.0 el8.aarch64 pgdg 18.3 KiB pg_auth_mon_17-5.0-5PGDG.rhel8.10.aarch64.rpm
pg_auth_mon_17 3.0 el8.aarch64 pgdg 16.7 KiB pg_auth_mon_17-3.0-1PGDG.rhel8.aarch64.rpm
pg_auth_mon_17 5.0 el9.x86_64 pgdg 17.8 KiB pg_auth_mon_17-5.0-5PGDG.rhel9.9.x86_64.rpm
pg_auth_mon_17 5.0 el9.aarch64 pgdg 17.8 KiB pg_auth_mon_17-5.0-5PGDG.rhel9.9.aarch64.rpm
pg_auth_mon_17 5.0 el10.x86_64 pgdg 17.9 KiB pg_auth_mon_17-5.0-5PGDG.rhel10.3.x86_64.rpm
pg_auth_mon_17 5.0 el10.aarch64 pgdg 18.1 KiB pg_auth_mon_17-5.0-5PGDG.rhel10.3.aarch64.rpm
pg_auth_mon_17 5.0 el10.aarch64 pgdg 18.1 KiB pg_auth_mon_17-5.0-5PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_17 3.0 el10.aarch64 pgdg 17.3 KiB pg_auth_mon_17-3.0-6PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_17 3.0 el10.aarch64 pgdg 17.4 KiB pg_auth_mon_17-3.0-3PGDG.rhel10.aarch64.rpm
postgresql-17-pg-auth-mon 5.0 d12.x86_64 pigsty 16.7 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~bookworm_amd64.deb
postgresql-17-pg-auth-mon 5.0 d12.aarch64 pigsty 17.0 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~bookworm_arm64.deb
postgresql-17-pg-auth-mon 5.0 d13.x86_64 pigsty 16.7 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~trixie_amd64.deb
postgresql-17-pg-auth-mon 5.0 d13.aarch64 pigsty 17.0 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~trixie_arm64.deb
postgresql-17-pg-auth-mon 5.0 u22.x86_64 pigsty 20.8 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~jammy_amd64.deb
postgresql-17-pg-auth-mon 5.0 u22.aarch64 pigsty 20.8 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~jammy_arm64.deb
postgresql-17-pg-auth-mon 5.0 u24.x86_64 pigsty 17.6 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~noble_amd64.deb
postgresql-17-pg-auth-mon 5.0 u24.aarch64 pigsty 17.7 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~noble_arm64.deb
postgresql-17-pg-auth-mon 5.0 u26.x86_64 pigsty 17.6 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~resolute_amd64.deb
postgresql-17-pg-auth-mon 5.0 u26.aarch64 pigsty 17.6 KiB postgresql-17-pg-auth-mon_5.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_auth_mon_16 5.0 el8.x86_64 pgdg 18.3 KiB pg_auth_mon_16-5.0-5PGDG.rhel8.10.x86_64.rpm
pg_auth_mon_16 2.0 el8.x86_64 pgdg 16.3 KiB pg_auth_mon_16-2.0-1.rhel8.x86_64.rpm
pg_auth_mon_16 5.0 el8.aarch64 pgdg 18.3 KiB pg_auth_mon_16-5.0-5PGDG.rhel8.10.aarch64.rpm
pg_auth_mon_16 2.0 el8.aarch64 pgdg 16.4 KiB pg_auth_mon_16-2.0-1.rhel8.aarch64.rpm
pg_auth_mon_16 5.0 el9.x86_64 pgdg 17.8 KiB pg_auth_mon_16-5.0-5PGDG.rhel9.9.x86_64.rpm
pg_auth_mon_16 5.0 el9.aarch64 pgdg 17.8 KiB pg_auth_mon_16-5.0-5PGDG.rhel9.9.aarch64.rpm
pg_auth_mon_16 5.0 el10.x86_64 pgdg 17.9 KiB pg_auth_mon_16-5.0-5PGDG.rhel10.3.x86_64.rpm
pg_auth_mon_16 5.0 el10.aarch64 pgdg 18.1 KiB pg_auth_mon_16-5.0-5PGDG.rhel10.3.aarch64.rpm
pg_auth_mon_16 5.0 el10.aarch64 pgdg 18.1 KiB pg_auth_mon_16-5.0-5PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_16 3.0 el10.aarch64 pgdg 17.3 KiB pg_auth_mon_16-3.0-6PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_16 3.0 el10.aarch64 pgdg 17.4 KiB pg_auth_mon_16-3.0-3PGDG.rhel10.aarch64.rpm
postgresql-16-pg-auth-mon 5.0 d12.x86_64 pigsty 16.7 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~bookworm_amd64.deb
postgresql-16-pg-auth-mon 5.0 d12.aarch64 pigsty 17.0 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~bookworm_arm64.deb
postgresql-16-pg-auth-mon 5.0 d13.x86_64 pigsty 16.7 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~trixie_amd64.deb
postgresql-16-pg-auth-mon 5.0 d13.aarch64 pigsty 17.0 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~trixie_arm64.deb
postgresql-16-pg-auth-mon 5.0 u22.x86_64 pigsty 20.8 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~jammy_amd64.deb
postgresql-16-pg-auth-mon 5.0 u22.aarch64 pigsty 20.7 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~jammy_arm64.deb
postgresql-16-pg-auth-mon 5.0 u24.x86_64 pigsty 17.6 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~noble_amd64.deb
postgresql-16-pg-auth-mon 5.0 u24.aarch64 pigsty 17.9 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~noble_arm64.deb
postgresql-16-pg-auth-mon 5.0 u26.x86_64 pigsty 17.6 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~resolute_amd64.deb
postgresql-16-pg-auth-mon 5.0 u26.aarch64 pigsty 17.6 KiB postgresql-16-pg-auth-mon_5.0-1PGSTY~resolute_arm64.deb
Package Version OS ORG SIZE File URL
pg_auth_mon_15 5.0 el8.x86_64 pgdg 18.3 KiB pg_auth_mon_15-5.0-5PGDG.rhel8.10.x86_64.rpm
pg_auth_mon_15 2.0 el8.x86_64 pgdg 16.3 KiB pg_auth_mon_15-2.0-1.rhel8.x86_64.rpm
pg_auth_mon_15 1.0 el8.x86_64 pgdg 23.5 KiB pg_auth_mon_15-1.0-1.rhel8.x86_64.rpm
pg_auth_mon_15 5.0 el8.aarch64 pgdg 18.3 KiB pg_auth_mon_15-5.0-5PGDG.rhel8.10.aarch64.rpm
pg_auth_mon_15 2.0 el8.aarch64 pgdg 16.4 KiB pg_auth_mon_15-2.0-1.rhel8.aarch64.rpm
pg_auth_mon_15 1.0 el8.aarch64 pgdg 23.5 KiB pg_auth_mon_15-1.0-1.rhel8.aarch64.rpm
pg_auth_mon_15 5.0 el9.x86_64 pgdg 17.8 KiB pg_auth_mon_15-5.0-5PGDG.rhel9.9.x86_64.rpm
pg_auth_mon_15 5.0 el9.aarch64 pgdg 17.8 KiB pg_auth_mon_15-5.0-5PGDG.rhel9.9.aarch64.rpm
pg_auth_mon_15 5.0 el10.x86_64 pgdg 17.9 KiB pg_auth_mon_15-5.0-5PGDG.rhel10.3.x86_64.rpm
pg_auth_mon_15 5.0 el10.aarch64 pgdg 18.1 KiB pg_auth_mon_15-5.0-5PGDG.rhel10.3.aarch64.rpm
pg_auth_mon_15 5.0 el10.aarch64 pgdg 18.1 KiB pg_auth_mon_15-5.0-5PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_15 3.0 el10.aarch64 pgdg 17.3 KiB pg_auth_mon_15-3.0-6PGDG.rhel10.2.aarch64.rpm
pg_auth_mon_15 3.0 el10.aarch64 pgdg 17.4 KiB pg_auth_mon_15-3.0-3PGDG.rhel10.aarch64.rpm
postgresql-15-pg-auth-mon 5.0 d12.x86_64 pigsty 16.7 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~bookworm_amd64.deb
postgresql-15-pg-auth-mon 5.0 d12.aarch64 pigsty 19.5 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~bookworm_arm64.deb
postgresql-15-pg-auth-mon 5.0 d13.x86_64 pigsty 16.7 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~trixie_amd64.deb
postgresql-15-pg-auth-mon 5.0 d13.aarch64 pigsty 17.0 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~trixie_arm64.deb
postgresql-15-pg-auth-mon 5.0 u22.x86_64 pigsty 20.7 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~jammy_amd64.deb
postgresql-15-pg-auth-mon 5.0 u22.aarch64 pigsty 20.7 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~jammy_arm64.deb
postgresql-15-pg-auth-mon 5.0 u24.x86_64 pigsty 17.6 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~noble_amd64.deb
postgresql-15-pg-auth-mon 5.0 u24.aarch64 pigsty 17.7 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~noble_arm64.deb
postgresql-15-pg-auth-mon 5.0 u26.x86_64 pigsty 17.6 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~resolute_amd64.deb
postgresql-15-pg-auth-mon 5.0 u26.aarch64 pigsty 17.6 KiB postgresql-15-pg-auth-mon_5.0-1PGSTY~resolute_arm64.deb

Source

pig build pkg pg_auth_mon;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

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

pig install pg_auth_mon -v 19;   # install for PG 19
pig install pg_auth_mon -v 18;   # install for PG 18
pig install pg_auth_mon -v 17;   # install for PG 17
pig install pg_auth_mon -v 16;   # install for PG 16
pig install pg_auth_mon -v 15;   # install for PG 15

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pg_auth_mon';

Create this extension with:

CREATE EXTENSION pg_auth_mon;

Usage

pg_auth_mon: Monitor authentication attempts

pg_auth_mon stores authentication attempt statistics per user, tracking successful and failed logins with timestamps.

CREATE EXTENSION pg_auth_mon;

Configuration

Add to postgresql.conf:

shared_preload_libraries = 'pg_auth_mon'

Optional GUC:

Parameter Default Description
pg_auth_mon.log_period 0 Dump stats to Postgres log every N minutes (0=off)

Querying Authentication Stats

SELECT * FROM pg_auth_mon;

The pg_auth_mon view provides per-user information:

Column Description
uid User OID (0 for invalid/non-existing usernames)
successful_auth_count Total number of successful logins
last_successful_auth Timestamp of last successful login
failed_auth_count Total number of failed authentications
last_failed_auth Timestamp of last failed login
hba_conflicts_count Count of HBA file conflicts

All login attempts with invalid usernames are aggregated into a single row with OID 0.

Table reader