Skip to main contentClaim $5 in free credit — one-time, per account. Claim $5 free
Krova CloudKrova Cloud
Database Hosting

PostgreSQL 19 MD5 Warnings: Check Clients Before Changing Authentication

PostgreSQL 19 can warn after a successful MD5 password login. Separate stored credentials, HBA rules and client support before rehearsing a SCRAM transition.

RB
Rohit Bhadani6 min read
Share
Database Hosting cover showing PostgreSQL 19 MD5 Warnings, a client-check subtitle, and a frosted-glass credential card and key connected to a database.

Imagine a scheduled importer connecting after your PostgreSQL 19 upgrade. It reads its records successfully, yet the connection reports an MD5 password warning. The job is working, so it's tempting either to ignore the message or to change authentication immediately. This is a hypothetical situation, but PostgreSQL 19 introduces exactly the kind of warning that can prompt that decision.

A PostgreSQL 19 MD5 warning after successful authentication is a migration signal, not evidence that the login failed. Check the clients, stored password format and matching authentication rule before moving the affected roles to SCRAM. Keep a controlled recovery path and verify new connections from the real workloads.

What the new warning actually tells you

PostgreSQL 19's release notes date the release to 19 November 2026 and list a new warning after successful MD5 password authentication. MD5 passwords were already deprecated in PostgreSQL 18. The documentation says support will be removed in a future release; it does not identify a removal version here.

The md5_password_warnings setting controls warnings for authentication with an MD5-encrypted password and for setting one through CREATE ROLE or ALTER ROLE. Its default is on. Turning the warning off changes reporting, not the stored credential or client compatibility.

Start by confirming the connected server and the relevant settings. Run these read-only observations in the session you're investigating; installing a newer psql client doesn't establish the server version.

SHOW server_version;
SHOW password_encryption;
SHOW md5_password_warnings;

Record the database endpoint, role and application build alongside the observation. If a pooler or proxy sits in the path, identify which component produced the warning. Don't silently turn a message from one connection into a diagnosis of every service.

Separate three pieces of evidence

QuestionEvidence to collectWhat it does not establish
What format is stored for the role?Privileged classification of the role's password verifierWhether every client can use the replacement format
Which authentication rule matches this connection?Actual connection type, source address, database, role and first matching HBA entryThat the file's method word alone proves the wire exchange
Which client makes the connection?Deployed driver/library and connection path, including a pooler if presentThat another tool's successful login proves this client works

The password_encryption reference concerns passwords when they are set. Seeing scram-sha-256 now doesn't show that old role passwords were rewritten. Treat that setting as a creation/reset policy, not an inventory of existing credentials.

For an authorized administrator, this illustrative query summarizes login-role password formats without returning the verifiers themselves. The pg_authid catalog reference documents the prefixes and restricted visibility. Don't grant an application access to this catalog just to run an audit.

SELECT CASE
         WHEN rolpassword IS NULL THEN 'no password'
         WHEN rolpassword LIKE 'SCRAM-SHA-256$%' THEN 'SCRAM'
         WHEN rolpassword LIKE 'md5%' THEN 'MD5'
         ELSE 'other'
       END AS stored_format,
       count(*) AS login_roles
FROM pg_authid
WHERE rolcanlogin
GROUP BY 1
ORDER BY 1;

These are stored-format counts, not active connections or successful authentications. A role with no password may use another intended authentication mechanism. Keep a private role-to-service inventory for planning, and avoid exporting password verifiers into tickets, logs or screenshots.

The md5 rule can select SCRAM

There is an important transition detail in PostgreSQL's password-authentication guide: when an HBA entry specifies md5 but the role stores a SCRAM password, PostgreSQL automatically selects SCRAM authentication. An older client can therefore encounter the compatibility change when the password is reset, before the HBA method is edited.

For the imagined importer, that means the change boundary isn't simply “the day we edit pg_hba.conf.” The password reset belongs in the deployment plan too. Identify every consumer of a shared role, including scheduled jobs and reporting tools that might not reconnect during a quick web check.

The HBA reference also specifies first-match behavior: PostgreSQL chooses the first entry matching the connection and does not try later entries after authentication fails. Check the actual path rather than appending a rule and assuming it takes effect. A local administrator connection can match a different rule from a remote worker.

Rehearse the transition with one controlled role

PostgreSQL's documented migration order is client compatibility first, SCRAM password creation next, then SCRAM authentication rules. Check every deployed library against its own documentation. A current desktop psql session isn't a compatibility certificate for an old application image.

In a separate test installation, use disposable credentials and a role representing one workload. Arrange administrative recovery access and review the credential rollout before changing it. This psql example sets the current session's password-creation choice and then prompts for a replacement password; it is an illustrative change, not an instruction to rotate a production role blindly.

SET password_encryption = 'scram-sha-256';
\password rehearsal_app

Replace rehearsal_app with your controlled test role and use an account permitted to change it. The psql reference documents the prompt-based command, which avoids putting the cleartext password in SQL command history. This session setting is not a server-wide policy change. Plan the persistent configuration and secret distribution separately.

After resetting the test credential, open a genuinely new connection using the same application build and path as the workload. An already authenticated connection cannot demonstrate that the next login will work. Exercise an innocuous query and confirm the expected role, endpoint and application result. Repeat from a worker or reporting process if it uses a different client.

Only after the relevant clients and credentials are ready should you move their matching HBA entries to scram-sha-256, using the reload procedure for your platform, and repeat the new-connection checks. Don't use trust, disable TLS verification or broaden network access to make an authentication rehearsal pass.

Make the finish line observable

If a pooler is involved, keep the application-to-pooler and pooler-to-PostgreSQL authentication contracts separate. Verify each component's supported configuration and reconnect behavior. The connection-budget guide explains why the two legs also need separate operational accounting.

For clients using ODBC, the psqlODBC driver inventory guide can help locate the library actually loaded by each process. Its patch checklist is a separate task; neither a driver patch nor a server upgrade proves that every credential and connection path has migrated.

Keep the warning visible as evidence while you track the affected consumers. The useful completion record is a set of verified fresh logins and application checks, with the intended role formats and matching rules, rather than a quiet log alone. If a client cannot reconnect in rehearsal, resolve that dependency before changing its production credential.

Rehearse PostgreSQL authentication on a Cube

Use a separate self-managed Linux Cube with disposable data to check the PostgreSQL server, deployed clients and credential rollout before changing a live workload.

Creation context: this article was researched and written with AI assistance, and its conceptual cover was AI-generated. The importer, SQL and migration rehearsal are illustrative. No database, client migration or customer workload was tested for this article.

For AI agents:llms.txtsitemap

Related posts