Note: The information in this article only pertains to Xbase++ builds prior to 2.00.1424!


Background

Starting with version 13 of PostgreSQL, the default authentication method was changed from MD5 to SCRAM. This authentication method is incompatible with the pqlib client dll used by the PostgreSQL Database Engine shipping with Xbase++ (status: build 1360). As a consequence, attempting to connect to a database from within an Xbase++ application fails with an "unsupported authentication method" error.

Configuring the PostgreSQL server

To revert the default authentication method to MD5, follow the procedure below:
  1. Change the password encryption method to md5 in the postgresql.conf file.
    password_encryption = md5 # md5 or scram-sha-256
  2. Edit your pg_hba.conf configuration file in your PostgreSQL installation. This file will most likely be located in the folder
    c:\program files\postgresql\13\data

    The authentication method is specified in the 5th ("Method") column and will be "scram-sha-256" for all of the supported network connections. Change this to "md5" as outlined in the following example:
    TYPE DATABASE USER ADDRESS METHOD host all all fe:80/10 md5

  3. Restart the PostgreSQL server. This can be done via Services applet (enter "Services" into the Windows search bar)
  4. Reset the password of the database user
    To do this, run PGAdmin and find the respective user(s) (probably "postgres") under "Login/Group Roles". (Re-) Assign the password in the "Definition" tab. This ensures the user's password is re-hashed using MD5. Otherwise, MD5 connections will fail because the password is still stored in SCRAM format and can't be used to authenticate the user.
After configuring your PostgreSQL 13 server, your Xbase++ application should be able to connect via MD5.