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

From Andres Freund
Subject Re: Proposal: Implement failover on libpq connect level.
Date
Msg-id 20150819134634.GA10770@awork2.anarazel.de
Whole thread Raw
In response to Re: Proposal: Implement failover on libpq connect level.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Proposal: Implement failover on libpq connect level.  (Oleg Bartunov <obartunov@gmail.com>)
Re: Proposal: Implement failover on libpq connect level.  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On 2015-08-19 09:41:32 -0400, Tom Lane wrote:
> In fact, they'd still need to use DNS balancing for Postgres,
> because not everything connects with libpq (think JDBC for instance).

It already does support this though.

https://jdbc.postgresql.org/documentation/head/connect.html :

> Connection Fail-over
> 
> To support simple connection fail-over it is possible to define multiple
> endpoints (host and port pairs) in the connection url separated by
> commas. The driver will try to once connect to each of them in order
> until the connection succeeds. If none succeed, a normal connection
> exception is thrown.
> 
> The syntax for the connection url is:
> 
> jdbc:postgresql://host1:port1,host2:port2/database


> So I think we ought to reject this proposal, full stop.  I see no
> reason to re-invent this wheel, and there are good reasons not to.

I don't really buy this argument. Allowing to connect to several
endpoints isn't exactly "new tech" either. A lot of database connectors
do support something very close to the above pgjdbc feature.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal: Implement failover on libpq connect level.
Next
From: Tom Lane
Date:
Subject: Re: DBT-3 with SF=20 got failed