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: 2016-09-08 11:24:20
Message-ID: 20160908142420.0609f202@fafnir.local.vm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Tue, 6 Sep 2016 07:58:28 +0530
Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com> wrote:

> On Mon, Sep 5, 2016 at 4:33 PM, Aleksander Alekseev <
> a(dot)alekseev(at)postgrespro(dot)ru> wrote:
> >After a brief examination I've found following ways to improve the
> >patch.
> Adding to above comments.
>
I'm sending new version of patch.

I've replaced readonly option with target_server_type (with JDBC
compatibility alias targetServerType),

use logic of setting defaults based on number of hosts in the connect
string instead of complicated condition in the state machine,

added checks for return values of memory allocation function.

Also, I've solved pg_usleep problem by linking pgsleep.c into libpq
along with some other libpgport objects which are already linked there.

Thus client applications don't need to link with libpgport and libpq
shared library is self-containted.

Attachment Content-Type Size
libpq-failover-8.patch text/x-patch 58.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-09-08 11:37:39 Re: GiST penalty functions [PoC]
Previous Message Craig Ringer 2016-09-08 11:10:23 Re: \timing interval

Browse pgsql-jdbc by date

  From Date Subject
Next Message Aleksander Alekseev 2016-09-08 14:44:05 Re: Patch: Implement failover on libpq connect level.
Previous Message Aleksander Alekseev 2016-09-07 14:32:11 Re: Patch: Implement failover on libpq connect level.