Hello Jelte,
This patch seems to have quite some use case overlap with my patch which
adds load balancing to libpq itself:
https://www.postgresql.org/message-id/flat/pr3pr83mb04768e2ff04818eeb2179949f7...@pr3pr83mb0476.eurprd83.prod.outlook.com
Thanks for the pointer.
The end purpose of the patch is to allow pgbench to follow a failover at
some point, at the client level, AFAICR.
My patch is only able to add "random" load balancing though, not
"round-robin". So this patch still definitely seems useful, even when mine
gets merged.
Yep. I'm not sure the end purpose is the same, but possibly the pgbench
patch could take advantage of libpq extension.
I'm not sure that the support for the "working" connection is necessary
from a feature perspective though (usability/discoverability is another
question). It's already possible to achieve the same behaviour by simply
providing multiple host names in the connection string. You can even tell
libpq to connect to a primary or secondary by using the
target_session_attrs option.
--
Fabien.