Re: Add Option To Check All Addresses For Matching target_session_attr

Andrew Jackson <andrewjackson947@gmail.com>

From: Andrew Jackson <andrewjackson947@gmail.com>
To: Evgeny Kuzin <evgeny.kuzin@outlook.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-05T21:15:26Z
Lists: pgsql-hackers
While I prefer your solution, I suspect that it would not be possible/worth
it to change the behavior at this point. It seems likely there is some
niche setup out there that relies on the current logic in some capacity.

I can imagine something along the lines of: someone sets up a hostname that
points to 2 IP records that each use different network infra or something
like that. In the case where you are looking for a primary you would not
want to duplicatively check the same host in this scenario because you
already confirmed that it is not the one you are looking for. With your
patch you would be increasing connection latency, probably not by that much
granted but this is the scenario that encouraged me to implement this as a
new parameter.

All that being said I'm fine with either patch and would love to see one of
them get merged. I suspect there are a lot of extraneous haproxy's that
have been set up in the wild that would be unneeded if one of our our
patches were merged and the changes proliferate to downstream drivers.

One note on your patch though: you may want to incorporate the unit tests
that I built out for this patch in yours.

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Support connection load balancing in libpq