Adrian Vogelsgesang <avogelsgesang@tableau.com> writes:
> Is there some way to let libpq fail the connection attempt in such a case, i.e. if a password was provided but not
requestedfrom the server?
Why would that be a useful thing to do?
> 1. To identify misconfigured server. In our use case, all servers should require a password. By failing hard and
early,we can more easily find misconfigured servers
I find that argument quite unconvincing. You can easily look into
pg_hba.conf to see if any lines don't have an auth method you like.
Moreover, that approach scales to requirements that are more complicated
than this specific use-case, and you can be sure that *all* the entries
satisfy your business rule, not just the one you happened to match this
time.
> Can I, as the client, force the authentication used during creating a connection to be scram-sha-256?
There has been discussion of that, but no one has written a patch yet.
regards, tom lane