postgresqlpostgresql-10postgresql-11postgresql-12

In PostgreSQL , can certificate authentication and basic authentication(username/password authentication) co-exist at one time?


Can we configure both Basic authentication and Certificate authentication for PostgreSQL simultaneously for the same IP address of client. I think no , because they are 2 different authentication mechanisms and cannot co-exist at same time... because if we configure for certificate authentication , then it cannot use username password for authentication , but have to use only certificates for authentication.

Please help.


Solution

  • I tried myself. In pg_hba.conf file, we can set MD5 authentication for 1 set of IP address and cert for another IP address range. So 1 Postgres server can address 2 different authentication for 2 different IP address