Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZqoNh-0006XT-7e for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Oct 2015 20:28:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZqoNg-0004V1-GR for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Oct 2015 20:28:36 +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 1ZqoNf-0004Tz-3F for pgsql-hackers@postgresql.org; Mon, 26 Oct 2015 20:28:35 +0000 Received: from mout.gmx.net ([212.227.15.15]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.84) (envelope-from ) id 1ZqoNc-0002YF-O1 for pgsql-hackers@postgresql.org; Mon, 26 Oct 2015 20:28:33 +0000 Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Lw1vh-1aa9at2uTd-017pvL for ; Mon, 26 Oct 2015 21:28:30 +0100 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id 4F7F62066D for ; Mon, 26 Oct 2015 16:28:29 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 26 Oct 2015 16:28:29 -0400 X-Sasl-enc: gCpoV+y/1tlw6GH8NygsOOwGrpIdF90SsXgKA6+/gX25 1445891309 Received: from [192.168.1.59] (unknown [204.145.120.11]) by mail.messagingengine.com (Postfix) with ESMTPA id F400DC00012; Mon, 26 Oct 2015 16:28:28 -0400 (EDT) Subject: Re: Patch (2): Implement failover on libpq connect level. To: Robert Haas , Korry Douglas References: <20150818041850.GA5092@wagner.pp.ru> <20151014104151.GA6744@wagner.pp.ru> <20151021090722.GA7825@wagner.pp.ru> <562A9259.4060408@enterprisedb.com> Cc: "pgsql-hackers@postgresql.org" From: Peter Eisentraut Message-ID: <562E8CEC.5010702@gmx.net> Date: Mon, 26 Oct 2015 16:28:28 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:hnTIobC2K+1w4wJ/p+ize7kujRDMHQ/GyJb+cjWdALXzxe9LOly CGmzG6M/x0OZAbNwVN7PMFLV247u3SSUYgHJOtV0bgbx0+vTkKPx7x3mSMSzQlFWaQI0EDW g9cYBIOW87T95sgqCpJ8XLEd0YshELtAWHZglKQRraufOq5tMAzZaSgF1cZUXcnpxVNyGub beBdOaYT0JNjQtOJTDCvA== X-UI-Out-Filterresults: notjunk:1;V01:K0:i5vmclQXPOs=:ssCMzcFfHLf4WfoZM9pwkw BjmLBhXliiUoEHaPf8HE9b4sxyvdizP3TiwFSVo5NyjToHdFhW6/S7kMDYz0qXHkHScPKkk/X 4zyv9Mh2NzXHbn7BoaTmtSuoqKdXwBqEkbCJd9qJls2SawgtUSSdx6PNgIeqGf+XTuixQihGq ogdjbDTFrnkB2FTOXWQ0jKFe+x3bQ8rb8hzlpU+qWZChuXN80ZNO8NGYKTA3DATskb1WyGPCZ ZPnFoUb6XF1WDjDCmxIzi9UX0+h/sCGV37imBvwcFuXCAj5SEjjCxgh9hiV2OKlfq0Vm/W6Nl mihh6EERjwX5aIPJF+qs30h1OZ2iJKZdpOx8YHfkn0KSdPTgVHdmpUse88nToUHkN4jmz8qHH oWmT3RilbtZUF5HBI9RssX+uuULvTl5x3OG9yifcrwYPRjHF5BnGlWe3fRnf/U1DmyzuOJXq+ ie9Ch6Vnq/sOCdkcZdGo40Sld1Nvpu8vdWHcOY74gW4qkB2ivkQ4oLdP7Q+cJtRyOhxikvKKL rBUTmrKDyIiL9jKToMt1taKBfNrBFuJ2HV8ddH9mRGu8/ZJinzZcMaf/q2HQdbTUC6zU5HDpn Rdskp+mjGU4uW9YuPy5ZU1V2XaCpVOtqemYoaktR9jbvNzQoMJfI3SYS7uCNK6oxxaIRUyWdR S9NkYIipLIfuEBwzIbZ5JOmm8+NtwJm32l1CxKmJRB6rIm3+0cE9AeSbTk+F2jClKMXqieY95 J8GCClNUUwzHlfkHrMq4JRAyJghhq1zfC9aV4c5q61Ydf+DbkQhgmwDNr+8SL1g5UF35H1yXZ A9RvBqD X-Pg-Spam-Score: -2.6 (--) 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 10/24/15 7:55 AM, Robert Haas wrote: > On Fri, Oct 23, 2015 at 4:02 PM, Korry Douglas > wrote: >> When you call pg_is_in_recovery(), you should schema-qualify the function >> name, just in case some other version of that function exists in the >> search_path. > > I wonder whether it's really a good idea to put this kind of logic > into libpq at all. I think there was some previous votes against > doing so, and I tend to agree with that viewpoint. Shouldn't probing > for the state of the connection be the caller's job, not libpq's? If > somebody wants to write a wrapper function around this that runs this > query after connecting - or any other query - they can do so. Well, earlier there was a debate whether any of this should be in libpq. I think asking for a read-only or read-write connection would be quite useful, and there isn't really a lot of room for interpretation that would lead to a lot of application-specific implementations. That said, it might still be best to omit this from the first round of the patch, to simplify the discussion. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers