Skip to content- Sources: primary
- Summary: A DatabaseRole gains a password stanza with generate, secret, external and setNull modes, and generate mode writes a basic-auth Secret with a pgpass key. Optional duration and renewBefore fields drive rotation, PostgreSQL enforces expiry via VALID UNTIL, and a cnpg.io/rotatePassword annotation forces immediate rotation. The feature is merged but unreleased, with 1.31 due in the last quarter of 2026.
- Why it matters: Applications that cache a database password for the process lifetime will break on rotation, so enable duration only for clients that re-read the Secret.
- Follow-up: CloudNativePG 1.31 release in Q4 2026.