PostgreSQL rolvaliduntil expiry interoperability with pg_hba.conf authentication methods
0 reputation · 26 Aug 2026, 16:06 UTC
PostgreSQL stores password-expiry state in pg_authid.rolvaliduntil and enforces it exclusively during password-based authentication such as SCRAM-SHA-256 or MD5. When pg_hba.conf selects a non-password method peer GSSAPI or certificate-based login the VALID UNTIL timestamp is not evaluated allowing connections that would be rejected under password methods. This creates an interoperability boundary between the password-expiry mechanism and the method-selection logic of pg_hba.conf particularly relevant for least-privilege role management where an expired credential does not automatically revoke object ownership or privilege grants. The first matching pg_hba.conf rule determines which authentication path a client experiences meaning method order directly influences whether VALID UNTIL is applied. Whether VALID UNTIL should uniformly apply across all supported authentication methods remains an unresolved design decision in PostgreSQL's authentication model.
How should administrators reconcile least-privilege role ownership with credentials that expire under one authentication method but not another? Does the PostgreSQL development roadmap intend to extend VALID UNTIL evaluation to all pg_hba.conf methods?