Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZS3hY-0006D3-90 for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 13:46:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZS3hX-0001ic-Rm for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Aug 2015 13:46:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZS3hX-0001gd-00 for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 13:46:47 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZS3hP-0000MI-WB for pgsql-hackers@postgresql.org; Wed, 19 Aug 2015 13:46:45 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id E9AE5860003; Wed, 19 Aug 2015 15:46:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 Received: from anarazel.de (p5DDC6530.dip0.t-ipconnect.de [93.220.101.48]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 7119C860002; Wed, 19 Aug 2015 15:46:35 +0200 (CEST) Received: by anarazel.de (Postfix, from userid 1000) id 04389101009; Wed, 19 Aug 2015 15:46:34 +0200 (CEST) Date: Wed, 19 Aug 2015 15:46:34 +0200 From: Andres Freund To: Tom Lane Cc: Albe Laurenz , '''Victor Wagner *EXTERN*' *EXTERN*' *EXTERN*' , "pgsql-hackers@postgresql.org" Subject: Re: Proposal: Implement failover on libpq connect level. Message-ID: <20150819134634.GA10770@awork2.anarazel.de> References: <20150818041850.GA5092@wagner.pp.ru> <20150819065146.GA31302@wagner.pp.ru> <20150819074417.GE31302@wagner.pp.ru> <30615.1439991692@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <30615.1439991692@sss.pgh.pa.us> X-Pg-Spam-Score: -4.8 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers