Hi Anjul,
There is not a simple solution to it, because as Jim already mentioned that HAproxy works on the 4th layer for PostgreSQL, it is difficult for HAproxy to meet the expectations here.
Also, it is not compulsory to use HAProxy as a front of Patroni. You may use Pgbouncer instead of HAProxy as well, however there some concerns associated with it.
Thanks,
--
On Mon, Nov 21, 2022 at 8:44 PM Anjul Tyagi <anjul@xxxxxxxxxxxxxxxx> wrote:
Team,We have setup in Postgres HA Cluster using Patroni. Also we have used the HAProxy for load balancing...On Postgres side, we are getting HaProxy IP instead of Client IP, while checking in pg_stat_activity tables. Can you please suggest the changes needs to be done on HAProxy or Postgres side?
Regards,
Anjul TYAGI
Group Technical Manager
If a solution exists, I’ll deliver it; If it doesn't exist, I’ll create it
ü Go Green