Re: Patch: Implement failover on libpq connect level.

From: Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2015-10-30 14:09:47
Message-ID: 20151030170947.3c069342@fafnir
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Fri, 30 Oct 2015 14:26:45 +0100
Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> On Thu, Oct 29, 2015 at 8:29 PM, Peter Eisentraut <peter_e(at)gmx(dot)net>
> wrote:

>
> That's true, but doesn't allowing every parameter to be multiply
> specified greatly increase the implementation complexity for a pretty
> marginal benefit? I think host and IP would hit 98% of the use cases
> here.

As far as I can tell from the experience of writing this patch, it
would greatly increase complexity.

If there should be only need to have multiple hosts, I could almost
completely incapsulate changes into DNS resolving code (which already
allows to handle several addresses). Need to support different port for
each host already required change of internal storage, and as a
consequence changes in the regression test suite
(src/interfaces/libpq/test/regress.out)

But both host and port are used in the same place - in the connect
system call. If we add possibility to different values per host for some
parameter, such as database name, which should be used significantly
later, i.e. during sending of first protocol message, size of patch
would grow may be twice.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2015-10-30 14:12:43 Re: Move PinBuffer and UnpinBuffer to atomics
Previous Message rafael 2015-10-30 13:57:30 Re: pg_dump

Browse pgsql-jdbc by date

  From Date Subject
Next Message Christopher Browne 2015-10-30 15:29:09 Re: Patch: Implement failover on libpq connect level.
Previous Message Robert Haas 2015-10-30 13:26:45 Re: Patch: Implement failover on libpq connect level.