Attached an updated patch which should address your feedback and I updated the commit message.
> I wonder whether making the parameter a boolean will paint us into a > corner I made it a string option, just like target_session_attrs. I'm pretty sure a round-robin load balancing policy could be implemented in the future given certain constraints, like connections being made within the same process. I adjusted the docs accordingly. > > +typedef struct > > +{ > > + int family; > > + SockAddr addr; > > +} AddrInfo; > > That last line looks weirdly indented compared to SockAddr; in the > struct above. Yes I agree, but for some reason pgindent really badly wants it formatted that way. I now undid the changes made by pgindent manually. > I wonder whether this needs to be documented if it is mostly a > development/testing parameter? I also wasn't sure whether it should be documented or not. I'm fine with either, I'll leave it in for now and let a committer decide if it's wanted or not. > A bit unclear why you put the variables at this point in the list, but > the list doesn't seem to be ordered strictly anyway; still, maybe they > would fit best at the bottom below target_session_attrs? Good point, I added them after target_session_attrs now and also moved docs/parsing accordingly. This makes conceptually to me as well, since target_session_attrs and load_balance_hosts have some interesting sense contextually too. P.S. I also attached the same pgindent run patch that I added in https://www.postgresql.org/message-id/flat/am5pr83mb0178d3b31ca1b6ec4a8ecc42f7...@am5pr83mb0178.eurprd83.prod.outlook.com
v6-0001-libpq-Run-pgindent-after-a9e9a9f32b3.patch
Description: v6-0001-libpq-Run-pgindent-after-a9e9a9f32b3.patch
v6-0002-Support-load-balancing-in-libpq.patch
Description: v6-0002-Support-load-balancing-in-libpq.patch