PostgreSQL 14, released on September 30, 2021, changes the default storage format for new database passwords from MD5 to SCRAM-SHA-256. Older client libraries may not support SCRAM. For a business upgrading its database, the documented behavior points to a delayed compatibility risk: an application could connect successfully, then fail after its database password is reset under the new default. [S1][S2]
The setting is password_encryption, and it takes effect when a password is set. PostgreSQL’s release notes say new passwords use the new format unless the setting is changed or the password is supplied in MD5 format. This is not a claim that installing version 14 rewrites every existing password. The operational distinction is between moving a database and changing the stored credentials that its applications use. [S1][S2]
Leaving md5 in pg_hba.conf, the file that controls client authentication, does not guarantee an MD5 exchange. The version 14 manual says that when an account has a SCRAM-stored password, an md5 authentication rule automatically selects SCRAM instead. An operator checking only that rule could miss the dependency on the account’s stored password. Changing the rule back to md5 would not, by itself, make a SCRAM password usable by a client that lacks SCRAM support. [S2]
The reverse boundary matters during a planned cutover. A password stored using MD5 can serve the md5 or password authentication methods, but not scram-sha-256. The manual’s migration sequence starts by making sure all client libraries in use support SCRAM, then setting password_encryption to scram-sha-256, having all users set new passwords, and changing the authentication rules to scram-sha-256. Keeping that order avoids treating a configuration edit as a substitute for updating credentials. [S2]
A useful acceptance test would connect through each application’s actual database client after setting a test account’s password under the new configuration. Scheduled jobs and administrative tools belong in that inventory too; one successful interactive connection would not test their clients. This suggested check exercises the combination the documentation says matters: the client library, the stored password format and the authentication rule. [S1][S2]
Source documents
- PostgreSQL 14 release noteshttps://raw.githubusercontent.com/postgres/postgres/REL_14_0/doc/src/sgml/release-14.sgml
- PostgreSQL 14 client authentication documentationhttps://raw.githubusercontent.com/postgres/postgres/REL_14_0/doc/src/sgml/client-auth.sgml
