I have recently tried my hands on Postgres. Installed it on local (PostgreSQL 13.0).
Created a maven project and used Spring Data JPA, works just fine. Whereas when I tried using Gradle project, I am not able to connect to the DB and keep getting the following error.
org.postgresql.util.PSQLException: The authentication type 10 is not
supported. Check that you have configured the pg_hba.conf file to
include the client’s IP address or subnet, and that it is using an
authentication scheme supported by the driver. at
org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:614)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.jdbc.PgConnection.(PgConnection.java:194)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.Driver.makeConnection(Driver.java:450)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.Driver.connect(Driver.java:252)
~[postgresql-42.1.4.jar:42.1.4] at
java.sql.DriverManager.getConnection(Unknown Source) [na:1.8.0_261]
at java.sql.DriverManager.getConnection(Unknown Source)
[na:1.8.0_261] at
org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:94)
[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:79)
[postgresql-42.1.4.jar:42.1.4]
I tried using JDBCTemplate as well. Doesn’t work
Modified the pg_hba.cfg file referring to this post — Doesn’t work
Used the deprecated Lib of — Doesn’t Work either.
Please Suggest me a solution for this problem.
My code and Config:
@Configuration
public class DataSourceConfig {
@Bean
public DriverManagerDataSource getDataSource() {
DriverManagerDataSource dataSourceBuilder = new DriverManagerDataSource();
dataSourceBuilder.setDriverClassName("org.postgresql.Driver");
dataSourceBuilder.setUrl("jdbc:postgresql://localhost:5432/postgres");
dataSourceBuilder.setUsername("postgres");
dataSourceBuilder.setPassword("root");
return dataSourceBuilder;
}
}
@Component
public class CustomerOrderJDBCTemplate implements CustomerOrderDao{
private DataSource dataSource;
private JdbcTemplate jdbcTemplateObject;
@Autowired
ApplicationContext context;
public void setDataSource() {
//Getting Bean by Class
DriverManagerDataSource dataSource = context.getBean(DriverManagerDataSource.class);
this.dataSource = dataSource;
this.jdbcTemplateObject = new JdbcTemplate(this.dataSource);
}
@Override
public Customer create(Customer customer) {
setDataSource();
String sql = "insert into CustomerOrder (customerType, customerPayment) values (?, ?)";
//jdbcTemplateObject.update(sql, customerOrder.getCustomerOrderType(), customerOrder.getCustomerOrderPayment());
KeyHolder holder = new GeneratedKeyHolder();
jdbcTemplateObject.update(new PreparedStatementCreator() {
@Override
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setString(1, customer.getType());
ps.setString(2, customer.getPayment());
return ps;
}
}, holder);
long customerId = holder.getKey().longValue();
customer.setCustomerID(customerOrderId);
return customer;
}
}
dependencies
implementation('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-devtools")
compile(group: 'org.postgresql', name: 'postgresql', version: '42.1.4')
compile("org.springdoc:springdoc-openapi-ui:1.4.1")
compile("org.springframework:spring-jdbc:5.2.5.RELEASE")
password_encryption is set like this:
postgres=# show password_encryption;
password_encryption
---------------------
scram-sha-256
(1 row)
Здравствуйте, вопрос такой, брал тестовое решение, аля «POSTGRES 1C» в котором локали ru.RU и в 8.3.18.1363 1С он просто не хочет базу создавать, даже свою, через галочку,но при этом я коннекчусь. Проблема у них в локалях и почему-то другие выбрать «низя» и их попросту нет.
Подумал и поставил обычный postgres, но теперь не могу в локальной сети приконнектится к друг-другу.
psql 13.2 & 1c 8.3.18.1363
Попросту пишет «authentication method 10 not supported», причем все данные введены верно, в консоли я работаю и через PG тоже. службы также запущены(очевидно)
pg_hba
# TYPE DATABASE USER ADDRESS METHOD
# «local» is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all md5
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
В самом конфиге стоит » * «
Возможно нужно установить какие-то дополнения к 1С «типа» ODBC или что-то такое ?
Я просто смотрел даже обычные ролики на YT и там делается все в два клика, но не у меня…)
upd: и да, это я делаю в форточке, на линукс не хотят люди переходить, слишком сложно им.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Open
harrisgomez opened this issue
Mar 12, 2021
· 8 comments
Comments
Hi, I’m running the latest version of PSequel v1.5.3 on a macOS Big Sur 11.2.2 and after opening up the app to connect to an existing db, I recently started seeing this error message. I checked SO for a fix but to no avail. Anyone else getting the same problem?
Have the same problem with PSequel v1.5.3 on Mac OS High Sierra 10.13.6, PostgreSQL 13.2. Thanks
also same. seems to do with the authentication method. doesnt support scram-sha-256 password encryption
Hey there,
Same too.
I managed to make it work changing the authentication to «password» instead of md5 or scram-sha-256.
https://www.postgresql.org/docs/10/auth-methods.html
I’m running BigSure 11.6 and using docker for postgres.
Here’s how I run it :
docker run --name <SOME_IMAGE_NAME> -e POSTGRES_PASSWORD=<SOME_PASSWORD> -e POSTGRES_USER=<SOME_USER> -e POSTGRES_HOST_AUTH_METHOD=password -p 5432:5432 -d postgres:14.0-alpine
On postgresql.conf file change:
This: password_encryption = scram-sha-256
To this: password_encryption = md5
On pg_hba.conf file change:
The method scram-sha-256 to md5 on all lines.
Recreate your user again (Delete it then create again).
Hey there, Same too. I managed to make it work changing the authentication to «password» instead of md5 or scram-sha-256. https://www.postgresql.org/docs/10/auth-methods.html
I’m running BigSure 11.6 and using docker for postgres.
Here’s how I run it :
docker run --name <SOME_IMAGE_NAME> -e POSTGRES_PASSWORD=<SOME_PASSWORD> -e POSTGRES_USER=<SOME_USER> -e POSTGRES_HOST_AUTH_METHOD=password -p 5432:5432 -d postgres:14.0-alpine
You are awesome dude,, i finally managed to make it work. Thanks
Issue
I have recently tried my hands on Postgres. Installed it on local (PostgreSQL 13.0).
Created a maven project and used Spring Data JPA, works just fine. Whereas when I tried using Gradle project, I am not able to connect to the DB and keep getting the following error.
org.postgresql.util.PSQLException: The authentication type 10 is not
supported. Check that you have configured the pg_hba.conf file to
include the client’s IP address or subnet, and that it is using an
authentication scheme supported by the driver. at
org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:614)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:222)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.jdbc.PgConnection.(PgConnection.java:194)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.Driver.makeConnection(Driver.java:450)
~[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.Driver.connect(Driver.java:252)
~[postgresql-42.1.4.jar:42.1.4] at
java.sql.DriverManager.getConnection(Unknown Source) [na:1.8.0_261]
at java.sql.DriverManager.getConnection(Unknown Source)
[na:1.8.0_261] at
org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:94)
[postgresql-42.1.4.jar:42.1.4] at
org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:79)
[postgresql-42.1.4.jar:42.1.4]
I tried using JDBCTemplate as well. Doesn’t work
Modified the pg_hba.cfg file referring to this post — Doesn’t work
Used the deprecated Lib of — Doesn’t Work either.
Please Suggest me a solution for this problem.
My code and Config:
@Configuration
public class DataSourceConfig {
@Bean
public DriverManagerDataSource getDataSource() {
DriverManagerDataSource dataSourceBuilder = new DriverManagerDataSource();
dataSourceBuilder.setDriverClassName("org.postgresql.Driver");
dataSourceBuilder.setUrl("jdbc:postgresql://localhost:5432/postgres");
dataSourceBuilder.setUsername("postgres");
dataSourceBuilder.setPassword("root");
return dataSourceBuilder;
}
}
@Component
public class CustomerOrderJDBCTemplate implements CustomerOrderDao{
private DataSource dataSource;
private JdbcTemplate jdbcTemplateObject;
@Autowired
ApplicationContext context;
public void setDataSource() {
//Getting Bean by Class
DriverManagerDataSource dataSource = context.getBean(DriverManagerDataSource.class);
this.dataSource = dataSource;
this.jdbcTemplateObject = new JdbcTemplate(this.dataSource);
}
@Override
public Customer create(Customer customer) {
setDataSource();
String sql = "insert into CustomerOrder (customerType, customerPayment) values (?, ?)";
//jdbcTemplateObject.update(sql, customerOrder.getCustomerOrderType(), customerOrder.getCustomerOrderPayment());
KeyHolder holder = new GeneratedKeyHolder();
jdbcTemplateObject.update(new PreparedStatementCreator() {
@Override
public PreparedStatement createPreparedStatement(Connection connection) throws SQLException {
PreparedStatement ps = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setString(1, customer.getType());
ps.setString(2, customer.getPayment());
return ps;
}
}, holder);
long customerId = holder.getKey().longValue();
customer.setCustomerID(customerOrderId);
return customer;
}
}
dependencies
implementation('org.springframework.boot:spring-boot-starter-web')
compile("org.springframework.boot:spring-boot-devtools")
compile(group: 'org.postgresql', name: 'postgresql', version: '42.1.4')
compile("org.springdoc:springdoc-openapi-ui:1.4.1")
compile("org.springframework:spring-jdbc:5.2.5.RELEASE")
password_encryption is set like this:
postgres=# show password_encryption;
password_encryption
---------------------
scram-sha-256
(1 row)
Solution
I solved similar issue by applying below steps in PostgreSQL Version 13 :
-
Change password_encryption to md5.
File: C:Program FilesPostgreSQL13datapostgresql.conf
-
Change
scram-sha-256tomd5in host settings.File: C:Program FilesPostgreSQL13datapg_hba.conf.
host all all 0.0.0.0/0 md5
-
Change Password ( this restore password in md5 format).
Example:
ALTER ROLE postgres WITH PASSWORD 'root'; -
Make sure you set
listen_addresses = '*'if you are working non production
environment.File :
C:Program FilesPostgreSQL13datapostgresql.conf
Answered By — Kishor K
Answer Checked By — Marilyn (JavaFixing Volunteer)
Are you looking for an answer to the topic “postgresql authentication method 10 not supported“? We answer all your questions at the website barkmanoil.com in category: Newly updated financial and investment news for you. You will find the answer right below.
Keep Reading
How do I enable Postgres authentication?
To authenticate network connections from the PostgreSQL server’s machine (non-socket connections) using passwords, you need to match a host connection type instead of local . You can then limit the acceptable addresses to the local loopback devices and allow users to authenticate using md5 or scram-sha-256 .
What are the recommended authentication protocols for PostgreSQL?
The following subsections describe the authentication methods in more detail.
- Trust Authentication. …
- Password Authentication. …
- GSSAPI Authentication. …
- SSPI Authentication. …
- Kerberos Authentication. …
- Ident Authentication. …
- Peer Authentication. …
- LDAP Authentication.
Fix PostgreSQL Fatal Password Error
Fix PostgreSQL Fatal Password Error
Fix PostgreSQL Fatal Password Error
Images related to the topicFix PostgreSQL Fatal Password Error
What is scram sha256?
The method scram-sha-256 performs SCRAM-SHA-256 authentication, as described in RFC 7677. It is a challenge-response scheme that prevents password sniffing on untrusted connections and supports storing passwords on the server in a cryptographically hashed form that is thought to be secure.
What is md5 authentication in PostgreSQL?
The password-based authentication methods are md5 and password. These methods operate similarly except for the way that the password is sent across the connection, namely MD5-hashed and clear-text respectively. If you are at all concerned about password “sniffing” attacks then md5 is preferred.
Which is an authentication method?
5 Common Authentication Types
- Password-based authentication. Passwords are the most common methods of authentication. …
- Multi-factor authentication. …
- Certificate-based authentication. …
- Biometric authentication. …
- Token-based authentication.
What is method in Pg_hba conf?
pg_hba. conf is the PostgreSQL access policy configuration file, which is located in the /var/lib/pgsql/10/data/ directory (PostgreSQL10) by default. The configuration file has 5 parameters, namely: TYPE (host type), DATABASE (database name), USER (user name), ADDRESS (IP address and mask), METHOD (encryption method)
How do I change the authentication in PostgreSQL?
Change PostgreSQL Authentication Method from Ident to MD5
- Pre-Flight Check. …
- Step #1: Switch to the PostgreSQL User: postgres. …
- Step #2: Add/Change the Password for the PostgreSQL User: postgres. …
- Step #3: Edit the Authentication Method. …
- Step #4: Verify Your Access.
See some more details on the topic postgresql authentication method 10 not supported here:
PostgreSQL + Postbird ‘authentication method 10 not supported’
I am using PostgreSQL (version 13) and Postbird (version 0.8.4). Everything is going well except for the fact that I cannot export the database …
+ Read More
Authentication Method 10 Not Supported Postgressql – ADocLib
authentication method 10 not supported. means, that you are using If you can log in through psql , you can use show hba_file; to see the real file being used.
+ View More Here
Authentication method 10 not supported (QGIS) – GIS Stack …
I have a problem when I am trying to connect the database that I have in pgadmin with my QGIS project. I am trying to create a New PostGIS …
+ View Here
Connection Error – Authentication method 10 not supported
Connection Error – Authentication method 10 not supported #221 … with PSequel v1.5.3 on Mac OS High Sierra 10.13.6, PostgreSQL 13.2.
+ View Here
What is Kerberos authentication in PostgreSQL?
Kerberos is one of the leading network security authentication protocols, recommended by EDB in the Postgres Vision 2021 Conference, and preferred and implemented in many large organizations. Kerberos is a ticket-based authentication system that authenticates between trusted hosts using strong encryption algorithms.
What is Postgres peer authentication?
The peer authentication method works by obtaining the client’s operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.
How does SCRAM authentication work?
Using cryptographic hashing techniques, a client can prove to a server that the user knows a secret derived from the user’s password without sending the password itself. The server can prove to the client that it knows a secret derived from the user’s password also without having to send the actual password.
What is authentication method SCRAM?
Salted Challenge Response Authentication Mechanism (SCRAM) is the default authentication mechanism for MongoDB. When a user authenticates themselves, MongoDB uses SCRAM to verify the supplied user credentials against the user’s name , password and authentication database .
What is SCRAM SHA?
Salted Challenge Response Authentication Mechanism (SCRAM), or SASL/SCRAM, is a family of SASL mechanisms that addresses the security concerns with traditional mechanisms that perform username/password authentication like PLAIN. Apache Kafka® supports SCRAM-SHA-256 and SCRAM-SHA-512 .
Тип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql
Тип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql
Тип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql
Images related to the topicТип аутентификации 10 файл pg_hba.conf / The authentication type 10 is not supported. Postgres sql
How do I connect to a postgres database?
Connecting to a Database
In order to connect to a database you need to know the name of your target database, the host name and port number of the server, and what user name you want to connect as. psql can be told about those parameters via command line options, namely -d , -h , -p , and -U respectively.
How do I connect to a PostgreSQL database?
So if your current user is a valid PostgreSQL user on your local database, you can connect by typing:
- psql.
- sudo –login –user=postgres. psql.
- sudo –login –user=postgres psql.
What is default password for postgres?
For most systems, the default Postgres user is postgres and a password is not required for authentication. Thus, to add a password, we must first login and connect as the postgres user.
What are the 3 methods of authentication?
Authentication factors can be classified into three groups: something you know: a password or personal identification number (PIN); something you have: a token, such as bank card; something you are: biometrics, such as fingerprints and voice recognition.
Which authentication method is best?
Biometric Authentication Methods
Biometric authentication relies on the unique biological traits of a user in order to verify their identity. This makes biometrics one of the most secure authentication methods as of today.
What are the 4 general forms of authentication?
Four-factor authentication (4FA) is the use of four types of identity-confirming credentials, typically categorized as knowledge, possession, inherence and location factors.
How do I get Postgres to accept remote connections?
13.4 Connecting to a Remote PostgreSQL Database
- Change the listening address in the postgresql. conf file. By default, PostgreSQL allows to listen for the localhost connection. …
- Add a client authentication entry to the pg_hba. conf file. …
- Test the remote connection. Restart the remote PostgreSQL server.
Why is Pg_hba conf used in PostgreSQL?
When PostgreSQL receives a connection request it will check the pg_hba. conf file to verify that the machine from which the application is requesting a connection has rights to connect to the specified database.
How do I whitelist an IP address in Postgres?
Using SQL Server Management Studio
- In Object Explorer, right-click a server and select Properties.
- Click the Connections node.
- Under Remote server connections, select or clear the Allow remote connections to this server check box.
How do I get Postgres to accept remote connections?
13.4 Connecting to a Remote PostgreSQL Database
- Change the listening address in the postgresql. conf file. By default, PostgreSQL allows to listen for the localhost connection. …
- Add a client authentication entry to the pg_hba. conf file. …
- Test the remote connection. Restart the remote PostgreSQL server.
What is LDAP authentication in PostgreSQL?
This authentication method operates similarly to password except that it uses LDAP as the password verification method. LDAP is used only to validate the user name/password pairs. Therefore the user must already exist in the database before LDAP can be used for authentication.
Part 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.
Part 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.
Part 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.
Images related to the topicPart 9 – PostgreSQL : What is pg_hba.conf file in PostgreSQL.
How do I connect to a Postgres database?
Connecting to a Database
In order to connect to a database you need to know the name of your target database, the host name and port number of the server, and what user name you want to connect as. psql can be told about those parameters via command line options, namely -d , -h , -p , and -U respectively.
What is authorization in Postgres?
Each connection to a PostgreSQL database is associated with a specific role that determines its initial level of access. Authorization policies determine what powers each role has within the database cluster, including what commands it can execute, what resources it can access, and what features it can use.
Related searches to postgresql authentication method 10 not supported
- please enter the password for the user postgres to connect the server postgresql 14
- Authentication method 10 not supported
- the authentication type 10 is not supported
- scram authentication requires libpq version 10 or above
- postgres authentication method 10 not supported
- postgresql13 authentication method 10 not supported
- pg_connect() unable to connect to postgresql server authentication method 10 not supported
- navicat postgresql authentication method 10 not supported
- postgresql error authentication method 10 not supported
- 1c postgresql authentication method 10 not supported
- error don t know how to auth: 10
- postgresql 14 authentication method 10 not supported
- authentication method 10 not supported docker
- Scram-sha-256 postgres
- the authentication type 10 is not supported.
- Postgresql hpa
- unable to connect to postgresql server authentication method 10 not supported php
- authentication method 10 not supported postgres
- authentication method 10 not supported
- postgresql hpa
- error don t know how to auth 10
- scram sha 256 postgres
Information related to the topic postgresql authentication method 10 not supported
Here are the search results of the thread postgresql authentication method 10 not supported from Bing. You can read more if you want.
You have just come across an article on the topic postgresql authentication method 10 not supported. If you found this article useful, please share it. Thank you very much.
© Laurenz Albe 2021
Since v10, PostgreSQL has provided support for scram-sha-256 for password hashing and authentication. This article describes how you can adapt your application safely.
Why do we need scram-sha-256?
PostgreSQL uses cryptographic hashing for two purposes:
- The actual database password is a hash of the clear text password entered by the user. This prevents a thief from using a stolen password on other systems.
- During password authentication, the client has to hash the (hashed) password with a random salt provided by the server. The password check is successful if the server receives the correct hashed response from the client.
Now, the MD5 hashing method has weaknesses that make it unsuitable for cryptography. In particular, it is too easy to construct a string with a given MD5 hash. These shortcomings do not apply to the way PostgreSQL uses MD5, but it still makes sense to use a better hashing algorithm:
- an expensive hash function makes brute force password attacks more difficult
- during a security audit, it looks better if PostgreSQL doesn’t use a hash function with weaknesses
Hence the introduction of scram-sha-256 support in v10. If you can, start using the new hashing method. The increased difficulty of brute force password attacks makes it worth the effort.
Problems with switching over to scram-sha-256
There are two problems that make it hard to switch over from MD5 to scram-sha-256:
- Since PostgreSQL does not know the original clear text password, the user has to set the password again, after you change the password encryption method to
scram-sha-256. - The PostgreSQL client has to support
scram-sha-256authentication, so authentication with older client software will fail.
The error message you get with an old version of libpq when you attempt to connect to a server that requires scram-sha-256 authentication is:
authentication method 10 not supported
An old JDBC driver will tell you:
The authentication type 10 is not supported.
Old versions of Npgsql will come back with:
Authentication method not supported (Received: 10)
Step-by-step instructions for switching to scram-sha-256
It is actually not difficult to convert to scram-sha-256, if you follow these guidelines:
1. Upgrade the client software
Upgrade all PostgreSQL client software and drivers that are too old to support the new authentication method. This is a good idea anyway, as it is never smart to get stuck with old, unmaintained software.
2. Change the password_encryption parameter
Edit postgresql.conf and change the parameter to
password_encryption = scram-sha-256
Make sure you remove the hash (#) at the beginning of the line. Then reload the server by running
pg_ctl reload -D /postgres/datadir
where /postgres/datadir is the PostgreSQL data directory. Alternatively, you can run this SQL statement:
SELECT pg_reload_conf();
Look into the log file to see if the reload was successful, and check the new value via SQL:
SHOW password_encryption;
Note that even though you changed the parameter, the old MD5 passwords still work, as long as the authentication method in pg_hba.conf is set to md5.
3. Set all passwords again
All password authenticated users have to change their password. In psql, a superuser can change any user’s password with
password user_name
Even if the user sets the same password as before, the password will now be hashed with SHA-256. Before proceeding with the next step, examine the table pg_authid and make sure that it contains no more MD5 hashed passwords.
4. Change the authentication method in pg_hba.conf
This step is not strictly necessary, because PostgreSQL will use scram-sha-256 authentication for scram-sha-256-hashed passwords, even if the authentication method is set to md5 in pg_hba.conf. This is a compatibility feature.
Still, you should adapt pg_hba.conf by replacing all occurrences of “md5” with “scram-sha-256”. That will prevent users who still have an old MD5 password from authenticating.
After that, reload the configuration as above. Then check the log file or examine the view pg_hba_file_rules to see if the reload was successful.
Conclusion
You can see from the above that it is not so difficult to change from md5 to scram-sha-256. The hard parts are that you have to set all the passwords again, and that you may have to upgrade the client software.
If you want to know how to protect yourself from common security problems, read Kaarel’s blog or my article about SECURITY DEFINER functions.
In order to receive regular updates on important changes in PostgreSQL, subscribe to our newsletter, or follow us on Twitter, Facebook, or LinkedIn.







