pg.ddx.io pgsql-jdbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Shulgin, Oleksandr <oleksandr.shulgin@zalando.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: Victor Wagner <vitus@wagner.pp.ru>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Proposal: Implement failover on libpq connect level.
Date: Thu, 3 Sep 2015 13:11:13 -0400
Message-ID: <20150903171113.GL3685@tamriel.snowman.net> (raw)
In-Reply-To: <20150903170406.GD2912@alvherre.pgsql>
References: <CA+TgmoaqUECxFDEyxLNQetw5uCS7FGhU1-851+rZZwogztbMPw@mail.gmail.com>
<20150901181222.GK31526@awork2.anarazel.de>
<CACACo5Q=5eV3Nw6ai8LJaLXx7R2D=UwWV3DAWdzP+4FJ2Su9EA@mail.gmail.com>
<CA+TgmobFhGkmY=S7yUx1LzoxQcP3pgo9eKPNEkCGEuKv7M9-oQ@mail.gmail.com>
<CACACo5SwSpT8dwTJdQ8QPNxgYbG5un-w=v=cMUZmeb5-mTCbUw@mail.gmail.com>
<CA+TgmoaTYx6nyxLpe+E1cbch98FmXJ6jmoW1ei5iWfEVp5dG_w@mail.gmail.com>
<20150903154221.GJ3685@tamriel.snowman.net>
<CA+Tgmobvj7ORhqg+CBfHgcBYmEn0U6F22rOrvb4VYHSzpzNKSQ@mail.gmail.com>
<CACACo5T-d3kOQF=E4OcPKknY4x6ti-kdjpycAA0HJ=QTqLbR9A@mail.gmail.com>
<20150903170406.GD2912@alvherre.pgsql>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
* Alvaro Herrera (alvherre@2ndquadrant.com) wrote:
> Shulgin, Oleksandr wrote:
>
> > > Alternatively, change the rules for parsing the existing host=X
> > > 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=X for that entry.
> >
> > 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.
>
> 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
Attachments:
signature.asc (application/pgp-signature, 818B) download
view thread (63+ messages) latest in thread
Message-ID: <20150903171113.GL3685@tamriel.snowman.net> Permalink: ../20150903171113.GL3685@tamriel.snowman.net/ Also on: postgresql.org/message-id/20150903171113.GL3685@tamriel.snowman.net ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients from your mail client; the link fills in the headers below: reply via email Some clients, webmail especially, drop In-Reply-To and References from a link, and the reply then starts a new thread: use the mbox below. To: pgsql-jdbc@postgresql.org Cc: sfrost@snowman.net, alvherre@2ndquadrant.com, oleksandr.shulgin@zalando.de, robertmhaas@gmail.com, andres@anarazel.de, tgl@sss.pgh.pa.us, laurenz.albe@wien.gv.at, vitus@wagner.pp.ru, pgsql-hackers@postgresql.org Subject: Re: Proposal: Implement failover on libpq connect level. In-Reply-To: <20150903171113.GL3685@tamriel.snowman.net> References: <CA+TgmoaqUECxFDEyxLNQetw5uCS7FGhU1-851+rZZwogztbMPw@mail.gmail.com> <20150901181222.GK31526@awork2.anarazel.de> <CACACo5Q=5eV3Nw6ai8LJaLXx7R2D=UwWV3DAWdzP+4FJ2Su9EA@mail.gmail.com> <CA+TgmobFhGkmY=S7yUx1LzoxQcP3pgo9eKPNEkCGEuKv7M9-oQ@mail.gmail.com> <CACACo5SwSpT8dwTJdQ8QPNxgYbG5un-w=v=cMUZmeb5-mTCbUw@mail.gmail.com> <CA+TgmoaTYx6nyxLpe+E1cbch98FmXJ6jmoW1ei5iWfEVp5dG_w@mail.gmail.com> <20150903154221.GJ3685@tamriel.snowman.net> <CA+Tgmobvj7ORhqg+CBfHgcBYmEn0U6F22rOrvb4VYHSzpzNKSQ@mail.gmail.com> <CACACo5T-d3kOQF=E4OcPKknY4x6ti-kdjpycAA0HJ=QTqLbR9A@mail.gmail.com> <20150903170406.GD2912@alvherre.pgsql> <20150903171113.GL3685@tamriel.snowman.net> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox