Re: [PATCH] libpq: try all addresses for a host before moving to next on target_session_attrs mismatch - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: [PATCH] libpq: try all addresses for a host before moving to next on target_session_attrs mismatch
Date
Msg-id CAKAnmmLXvBS1YTOeR=df3e7e+VMzG-y-_MZ7e+_E_T5pDc8QSA@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] libpq: try all addresses for a host before moving to next on target_session_attrs mismatch  (Evgeny Kuzin <evgeny.kuzin@outlook.com>)
List pgsql-hackers
On Wed, Mar 11, 2026 at 10:29 AM Evgeny Kuzin <evgeny.kuzin@outlook.com> wrote:
A refinement: what if we only change behavior when target_session_attrs is explicitly set to something other than any?

-1. That seems to complicate things further, and still doesn't make our code match our docs

resolving to both "127.0.0.1" and "::1",

Bit of a contrived case, but I'm not really seeing the problem here. It's certainly possible for postgres to be listening on one and not the other, and if you want to connect to a specific one, then call it out by name. Otherwise, they all get tried, which is the whole reason the Internet has those one to many mappings. To give up after the first one fails seems inherently wrong.

Cheers,
Greg

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Change initdb default to the builtin collation provider
Next
From: Bertrand Drouvot
Date:
Subject: Re: Defend against -ffast-math in meson builds