Re: Patch: Implement failover on libpq connect level.

From: Mithun Cy <mithun(dot)cy(at)enterprisedb(dot)com>
To: Catalin Iacob <iacobcatalin(at)gmail(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>, Peter van Hardenberg <pvh(at)pvh(dot)ca>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-11-24 12:16:48
Message-ID: CAD__OugZw4oVQG+Qorc3KTVWEPe1uQ4ju01nNj0r80iRt952bA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackerspgsql-jdbc

On Wed, Nov 23, 2016 at 10:19 PM, Catalin Iacob <iacobcatalin(at)gmail(dot)com>
wrote:
On Tue, Nov 22, 2016 at 8:38 AM, Tsunakawa, Takayuki <
tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
>> If you want to connect to a server where the transaction is read-only,
then shouldn't the connection parameter be something like
>>"target_session_attrs=readonly"? That represents exactly what the code
does.

>FWIW I find this to be a reasonable compromise. To keep the analogy
>with the current patch it would be more something like
"target_session_attrs=read_write|any".

I have taken this suggestion now renamed target_server_type to
target_session_attrs with possible 2 values "read-write", "any".
May be we could expand to "readonly" and "prefer-readonly" in next patch
proposal. Attaching the patch for same.
--
Thanks and Regards
Mithun C Y
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
failover-to-new-writable-session-05.patch application/octet-stream 12.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2016-11-24 12:45:40 Re: Push down more full joins in postgres_fdw
Previous Message Rushabh Lathia 2016-11-24 12:12:22 Re: Gather Merge

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jorge Solórzano 2016-11-25 04:44:37 Versioning policy PgJDBC - discussion
Previous Message Catalin Iacob 2016-11-23 16:49:29 Re: Patch: Implement failover on libpq connect level.