Skip to content

pg_login_stat

Per-user and per-database successful and failed authentication counters.

pg_login_stat · Per-user and per-database successful and failed authentication counters.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
101915pg_login_statpg_login_stat1.0STATC

PostgreSQL · 15, 16, 17

Usage

Sources:

pg_login_stat Per-user and per-database successful and failed authentication counters.

Enablement

Merge pg_login_stat into the existing preload list, restart PostgreSQL, and then create pg_login_stat in each database that needs its SQL objects:

shared_preload_libraries = 'pg_login_stat'
CREATE EXTENSION pg_login_stat;

Core Workflow

The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.

SELECT * FROM pg_login_stats;

Main Objects

The reviewed install surface includes these prominent objects:

ObjectKindOperational role
pg_login_statsVIEWInspection or query view created by the extension.
pg_login_stat_resetFUNCTIONCallable function from the reviewed install surface.

Operations and Boundaries

  • The verified PostgreSQL-major evidence covers 15, 16, 17; do not infer unlisted majors.
  • Preloading pg_login_stat changes cluster startup state; stage configuration and restart changes separately from CREATE EXTENSION.

Table reader