When the server is configured to use trust authentication with a clientcert requirement or to use cert authentication, a man-in-the-middle attacker can inject arbitrary SQL queries when a connection is first established, despite the use of SSL certificate verification and encryption.
https://www.postgresql.org/support/security/CVE-2021-23214/
https://security.gentoo.org/glsa/202211-04
https://github.com/postgres/postgres/commit/28e24125541545483093819efae9bca603441951