libpq: Allow connection strings and URIs to specify multiple hosts

Enterprise / PostgreSQL - Robert Haas [postgresql.org] - 3 November 2016 08:25 UTC

It's also possible to specify a separate port for each host.

Previously, we'd loop over every address returned by looking up the host name; now, we'll try every address for every host name.

Patch by me. Victor Wagner wrote an earlier patch for this feature, which I read, but I didn't use any of his code. Review by Mithun Cy.

274bb2b libpq: Allow connection strings and URIs to specify multiple hosts.
doc/src/sgml/libpq.sgml | 38 ++-
src/interfaces/libpq/fe-auth.c | 28 +-
src/interfaces/libpq/fe-connect.c | 607 ++++++++++++++++++++++++++-----------
src/interfaces/libpq/libpq-int.h | 41 ++-
4 files changed, 506 insertions(+), 208 deletions(-)

Upstream: git.postgresql.org


  • Share