Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Databases and Redis

An old PostgreSQL client says authentication method 10 not supported

Errorauthentication method 10 not supported

Short answer

Method 10 is SASL, which PostgreSQL uses for SCRAM-SHA-256 password login. A client built on a libpq from before PostgreSQL 10 cannot do it and prints this error. Upgrade the client library or driver. If you truly cannot, store that role's password as md5 and use md5 in pg_hba.conf, knowing md5 is deprecated.

  • Applies to PostgreSQL 14, PostgreSQL 16, PostgreSQL 17
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask the server which hash type new passwords get, and check which client version is actually running.

    psql --version
    # on the server, in psql:
    SHOW password_encryption;
  2. 2Match what you see, then jump to its fix

    1. 1The same user and password work from a new psql on the server, but fail from an old tool, an old PHP or Python build, or a legacy desktop client.The client library is older than SCRAM supportFix
    2. 2A legacy application you cannot change must keep connecting.The client cannot be upgraded; allow md5 for that role onlyFix

What does the error look like?

  • authentication method 10 not supported

Cause 1 of 2

The client library is older than SCRAM support

1Check

The server asks for SASL with the protocol code 10 when the role's password is stored as SCRAM. A client that only knows the older methods reaches its default case and reports the code as unsupported. SCRAM support was added in PostgreSQL 10, so the library must be from that release or later.

psql --version

2Fix

Upgrade the client package or the driver that bundles libpq, then reconnect. Rebuild the language extension against the new libpq if it links the library statically.

# Ubuntu 24.04: install the current client
sudo apt update && sudo apt install postgresql-client

3Verify

A fresh connection with the same credentials succeeds.

psql "host=localhost dbname=postgres user=my_user" -c 'select 1'

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 2 of 2

The client cannot be upgraded; allow md5 for that role only

1Check

The server's password_encryption setting decides the hash for a password set with CREATE ROLE or ALTER ROLE. The default is scram-sha-256. Existing md5 hashes are not converted automatically, and an md5 hash still works with an md5 line in pg_hba.conf.

SHOW password_encryption;

2Fix

Set password_encryption to md5 in postgresql.conf, reload the server, set the role's password again, and make the matching pg_hba.conf line use md5. The documentation marks md5 as deprecated, so treat this as a stopgap, and set the value back to scram-sha-256 once the client is upgraded.

# postgresql.conf
password_encryption = 'md5'

-- then, in psql:
ALTER ROLE my_user WITH PASSWORD 'new-password-here';

# pg_hba.conf
host  all  my_user  10.0.0.0/8  md5

3Verify

Reload the server, then connect with the old client.

psql "host=db.example.com dbname=postgres user=my_user" -c 'select 1'

Confirmed by postgresql.org

Did this fix it?

How do I stop it coming back?

  • Keep client drivers and libpq on supported versions before moving a server to PostgreSQL 14 or newer.
  • Before changing password_encryption, confirm every client library you use supports SCRAM.
  • Plan to move md5 roles to scram-sha-256: set the new password, then change the method in pg_hba.conf.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.