Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXY2i-0000Ko-1B for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2015 17:11:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZXY2h-0001id-CE for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Sep 2015 17:11:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZXY2f-0001eT-Aj for pgsql-hackers@postgresql.org; Thu, 03 Sep 2015 17:11:17 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZXY2c-0002NO-AP for pgsql-hackers@postgresql.org; Thu, 03 Sep 2015 17:11:16 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id BC0AB5F7A5; Thu, 3 Sep 2015 13:11:13 -0400 (EDT) Date: Thu, 3 Sep 2015 13:11:13 -0400 From: Stephen Frost To: Alvaro Herrera Cc: "Shulgin, Oleksandr" , Robert Haas , Andres Freund , Tom Lane , Albe Laurenz , Victor Wagner , "pgsql-hackers@postgresql.org" Subject: Re: Proposal: Implement failover on libpq connect level. Message-ID: <20150903171113.GL3685@tamriel.snowman.net> References: <20150901181222.GK31526@awork2.anarazel.de> <20150903154221.GJ3685@tamriel.snowman.net> <20150903170406.GD2912@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2kORF7fzdsSdBt+T" Content-Disposition: inline In-Reply-To: <20150903170406.GD2912@alvherre.pgsql> X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-61-generic (x86_64) X-Uptime: 13:09:17 up 30 days, 1:39, 8 users, load average: 0.06, 0.13, 0.13 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) 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 --2kORF7fzdsSdBt+T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Alvaro Herrera (alvherre@2ndquadrant.com) wrote: > Shulgin, Oleksandr wrote: >=20 > > > Alternatively, change the rules for parsing the existing host=3DX > > > parameter so that we split it on some separator that isn't a valid > > > hostname character, and then strip off an optional :port syntax from > > > each entry; that value, if present, overrides port=3DX for that entry. > >=20 > > It's tempting to use ':' as the separator here, but it's still valid for > > directory names and host can be one in case of UN*X sockets. >=20 > I think that's rare enough that we could just say that if you want to > have a : in a directory name used for local connections, you have to > escape the : character. This is going to be pretty easy to detect as a > problem because of the obvious error message ("cannot parse "pg" in > /usr/sockets:pg as a port number"), except in the even rarer case that > the only stuff after the colon is digits. If we really want to worry about this, we could simply check if the directory exists with the ':5433' or whatever at the end and, if it does, use whatever the port specification is. If that directory doesn't exist, and one without the ':5433' does, then we try that directory and that port. Personally, I agree with Alvaro that it's really just overkill to worry about though. Thanks! Stephen --2kORF7fzdsSdBt+T Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJV6H8xAAoJEO1sijiDR2RVJKkQAMgoxpO7ZjjBffFgUBeh/bEo qj6xFQjmbNtVzcZuXfm3l0LAU3Q/sdeUftsHtskg33lzVGz3/tqr+3q9tmTJh62R 1JRcjG2f87JSM/AHFkcK4ejViUn05bngMCaG9cJXJ49dZQJPDlWqwHSA2DQ/mBhX 7vkWSm/fgMXuwfAh4UYSVVGnXPa5b9G/rsH8rdKmazPKRIHyUvbtjwg7vhtYcU7b Qa23eQQvq5Ncpw4ghWz0NgCAWFjCvlPmp8jo+xwmIEs0UU49MEY2Sguy2Sbu9tZa fze0U0mh3smP9UnezTcPwPWyZuW6bb61IdrJjtkQ2dQKub4+2V00ntkOHPa3cYwQ X15X3o6IABOFPsXYapl8yI45G5zFQNBk/dywxWol7U6W64+MktvYTTUxBQ2/HXM8 vauSUO7g1f2EGaa8iDjVxy0G1o9unCBpo02KWNJXIDcWgpBDlBNyoY85a8SBv6bt oQm1PjsNifQ1fggPTn6AoOzgvjdVZ+3CTP7dAsLbdONysezUluf9n5kvOiSU5Oq1 35MbQzOSA3bczCuZs6sAYyY5IUGKzLYzH18ARD8lqtAJ4t9U1oOVUbjQc6OF5hpS 8WOgsW97wtYTgIdj1W+mYcIA+hEgnteW4CTC2nNg8SaCr+Y9SBWa1uMSWD4h/L2N QlrV0roLyzSbtHjQTEmb =hrli -----END PGP SIGNATURE----- --2kORF7fzdsSdBt+T--