Re: [bug fix] PG10: libpq doesn't connect to alternative hosts when some errors occur

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] PG10: libpq doesn't connect to alternative hosts when some errors occur
Date: 2017-05-18 11:06:48
Message-ID: CAB7nPqR8Fus04h=+KUDidBqxmsK0iKHW64ux_Qqo38oL7WcW3Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 18, 2017 at 5:05 PM, Tsunakawa, Takayuki
<tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com> wrote:
> So, how about trying connection to the next host when the class code is neither 28, 3D, nor 42?
>
> Honestly, I'm not happy with this approach, for a maintenance reason that others are worried about. Besides, when the connection target is not postgres and returns invalid data, no SQLSTATE is available. I'm sorry to repeat myself, but I believe PgJDBC's approach is practically good. If you think the SQLSTATE is the only way to go, I will put up with it. It would be disappointing if nothing is done.

FWIW, I am of the opinion to not have an implementation based on any
SQLSTATE codes, as well as not doing something similar to JDBC.
Keeping things simple is one reason, a second is that the approach
taken by libpq is correct at its root.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2017-05-18 11:22:43 Re: UPDATE of partition key
Previous Message Amit Langote 2017-05-18 10:16:40 Re: transition table behavior with inheritance appears broken (was: Declarative partitioning - another take)