Re: Patch: Implement failover on libpq connect level. - Mailing list pgsql-hackers

From Catalin Iacob
Subject Re: Patch: Implement failover on libpq connect level.
Date
Msg-id CAHg_5gpL-11ds0z7LuQSVPb66YWctf6Tx=UvsVs071=3M0B+yw@mail.gmail.com
Whole thread Raw
In response to Re: Patch: Implement failover on libpq connect level.  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Patch: Implement failover on libpq connect level.
List pgsql-hackers
On Tue, Nov 15, 2016 at 5:58 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Tue, Nov 15, 2016 at 9:42 AM, Alvaro Herrera
> <alvherre@2ndquadrant.com> wrote:
>> I would rather come up with something that works in both cases that we
>> can extend internally later, say pg_is_primary_node() or something like
>> that instead; and we implement it initially by returning the inverse of
>> pg_is_in_recovery() for replicated non-logical flocks, while we figure
>> out what to do in logical replication.  Otherwise it will be harder to
>> change later if we embed it in libpq, and we may be forced into
>> supporting nonsensical situations such as having pg_is_in_recovery()
>> return true for logical replication primary nodes.
>
> I don't think we'll be backed into a corner like that, because we can
> always make this contingent on server version.  libpq will have that
> available.

But even with server version checking code, that code will be inside
libpq so there will be old libpq versions in the field that won't know
the proper query to send to new server versions.



pgsql-hackers by date:

Previous
From: Tobias Bussmann
Date:
Subject: Re: Parallel execution and prepared statements
Next
From: Catalin Iacob
Date:
Subject: Re: Patch: Implement failover on libpq connect level.