Connection-fail-over - Mailing list pgsql-jdbc

From Mikko Tiihonen
Subject Connection-fail-over
Date
Msg-id 4FB52EBB.4060309@nitorcreations.com
Whole thread Raw
Responses Re: Connection-fail-over  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-jdbc
Hi,

I have been thinking of adding connection fail-over support to the jdbc driver. What this means is that there would be
away to specify more than host:port pair  
to connect to. This will become handy with high-availability installations.

Currently the limitation of hostname means that there has to be a virtual ip address that is moved with the active
backend,which is a complex solution that can  
break.

If we have list of hostname:port pairs we just have to make sure that only the master database allows connections from
thejdbc clients. 

Before I implement this I would like to first ask opinions on how the connection url should look like.

Current syntax is:

jdbc:postgresql://hostname:port/database?options

Which of these should we support:

A) jdbc:postgresql://hostname1:port1,hostname2:port2/database?options
B) jdbc:postgresql://hostname1,hostname2:port/database?options
C) jdbc:postgresql://hostname1:port1/database?&failoverhost=hostname2:port2&options
D) some other?

-Mikko

pgsql-jdbc by date:

Previous
From: Jesper Pedersen
Date:
Subject: Pull request: Use .valueOf()
Next
From: Heikki Linnakangas
Date:
Subject: Re: Connection-fail-over