pgsql: Allow multiple hostaddrs to go with multiple hostnames.

Started by Heikki Linnakangasover 8 years ago4 messages
#1Heikki Linnakangas
heikki.linnakangas@iki.fi

Allow multiple hostaddrs to go with multiple hostnames.

Also fix two other issues, while we're at it:

* In error message on connection failure, if multiple network addresses
were given as the host option, as in "host=127.0.0.1,127.0.0.2", the
error message printed the address twice.

* If there were many more ports than hostnames, the error message would
always claim that there was one port too many, even if there was more than
one. For example, if you gave 2 hostnames and 5 ports, the error message
claimed that you gave 2 hostnames and 3 ports.

Discussion: /messages/by-id/10badbc6-4d5a-a769-623a-f7ada43e14dd@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7b02ba62e9ffad5b14c24756a0c2aeae839c9d05

Modified Files
--------------
doc/src/sgml/libpq.sgml | 55 +++++++-
src/interfaces/libpq/fe-connect.c | 258 ++++++++++++++++++++++++--------------
src/interfaces/libpq/libpq-int.h | 3 +-
3 files changed, 219 insertions(+), 97 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Heikki Linnakangas (#1)
1 attachment(s)
Re: [COMMITTERS] pgsql: Allow multiple hostaddrs to go with multiple hostnames.

On Mon, Jul 10, 2017 at 6:30 PM, Heikki Linnakangas
<heikki.linnakangas@iki.fi> wrote:

Allow multiple hostaddrs to go with multiple hostnames.

Also fix two other issues, while we're at it:

* In error message on connection failure, if multiple network addresses
were given as the host option, as in "host=127.0.0.1,127.0.0.2", the
error message printed the address twice.

* If there were many more ports than hostnames, the error message would
always claim that there was one port too many, even if there was more than
one. For example, if you gave 2 hostnames and 5 ports, the error message
claimed that you gave 2 hostnames and 3 ports.

Discussion: /messages/by-id/10badbc6-4d5a-a769-623a-f7ada43e14dd@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7b02ba62e9ffad5b14c24756a0c2aeae839c9d05

Modified Files
--------------
doc/src/sgml/libpq.sgml | 55 +++++++-
src/interfaces/libpq/fe-connect.c | 258 ++++++++++++++++++++++++--------------
src/interfaces/libpq/libpq-int.h | 3 +-
3 files changed, 219 insertions(+), 97 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

Hi,

This commit seems be cause of the documentation compilation error. I
think </sect3> is missing.

$ make -C doc/src/sgml/
make: Entering directory `/home/masahiko/pgsql/source/postgresql/doc/src/sgml'
osx -wall -wno-unused-param -wno-empty -wfully-tagged -D . -D . -x
lower postgres.sgml >postgres.xml.tmp
osx:libpq.sgml:926:9:E: end tag for "SECT3" omitted, but OMITTAG NO
was specified
osx:libpq.sgml:891:3: start tag was here
make: *** [postgres.xml] Error 1
make: Leaving directory `/home/masahiko/pgsql/source/postgresql/doc/src/sgml'

Attached small patch fixes this.

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachments:

fix_doc.patchtext/x-patch; charset=US-ASCII; name=fix_doc.patchDownload
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 124c21b..98b6938 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -923,6 +923,7 @@ postgresql://%2Fvar%2Flib%2Fpostgresql/dbname
        host, it is not possible to e.g. specify a different username for 
        different hosts.
      </para>
+   </sect3>
   </sect2>
 
   <sect2 id="libpq-paramkeywords">
#3Heikki Linnakangas
hlinnaka@iki.fi
In reply to: Masahiko Sawada (#2)
Re: pgsql: Allow multiple hostaddrs to go with multiple hostnames.

On 07/10/2017 01:27 PM, Masahiko Sawada wrote:

This commit seems be cause of the documentation compilation error. I
think </sect3> is missing.

...

Attached small patch fixes this.

Thanks, committed!

Strangely, it worked on my system, despite that clear mistake. Looks
like the 'osx' tool is more strict than what I had installed. I have now
also installed opensp, so won't make this mistake again.

- Heikki

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#4Masahiko Sawada
sawada.mshk@gmail.com
In reply to: Heikki Linnakangas (#3)
Re: pgsql: Allow multiple hostaddrs to go with multiple hostnames.

On Mon, Jul 10, 2017 at 10:01 PM, Heikki Linnakangas <hlinnaka@iki.fi> wrote:

On 07/10/2017 01:27 PM, Masahiko Sawada wrote:

This commit seems be cause of the documentation compilation error. I
think </sect3> is missing.

...

Attached small patch fixes this.

Thanks, committed!

Strangely, it worked on my system, despite that clear mistake. Looks like
the 'osx' tool is more strict than what I had installed. I have now also
installed opensp, so won't make this mistake again.

Thank you!

Regards,

--
Masahiko Sawada
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers