Re: Patch: Implement failover on libpq connect level.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Peter van Hardenberg <pvh(at)pvh(dot)ca>, Peter Eisentraut <peter_e(at)gmx(dot)net>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch: Implement failover on libpq connect level.
Date: 2016-10-25 17:23:51
Message-ID: CA+TgmoaBOCVv90muUo3GZEvq4jwGkPSwL142MsVfvxX+0hkYVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Mon, Oct 24, 2016 at 4:40 PM, Alvaro Herrera
<alvherre(at)2ndquadrant(dot)com> wrote:
> Umm, my recollection regarding IPv6 parsing in the URI syntax is that
> those must appear inside square brackets -- it's not valid to have the
> IPv6 address outside brackets, and the port number is necessarily
> outside the brackets. So there's no ambiguity. If the current patch is
> allowing IPv6 address to appear outside of brackets, that seems like a
> bug to me.

I agree.

> The string conninfo spec should not accept port numbers in the "host"
> part. (Does it?)

Not currently, but the proposed patch would cause it to do so.

>> So now I think that to make this work correctly, we're going to need
>> to change both the URL parser and also add parsing for the host and
>> port. Let's say the user says this:
>>
>> postgresql://[1::2]:3,[4::5],[6::7]::8/
>
> (There's a double colon before 8, I suppose that's just a typo.)

Oh, yeah. Right.

>> It is not obvious what it means if there are multiple ports but the
>> number doesn't equal the number of hosts.
>
> I think we should reject the case of differing number of elements and
> neither host nor port is a singleton, as an error. The suggestion to
> ignore some parts seems too error-prone.

OK, can do.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-10-25 17:26:07 Re: Patch: Implement failover on libpq connect level.
Previous Message Robert Haas 2016-10-25 17:19:26 Re: Wraparound warning

Browse pgsql-jdbc by date

  From Date Subject
Next Message Robert Haas 2016-10-25 17:26:07 Re: Patch: Implement failover on libpq connect level.
Previous Message Ziyun Audrey Wang 2016-10-25 16:45:06 postgresql support new time zone TRT