Re: Patch: Implement failover on libpq connect level.
Mithun Cy <mithun.cy@enterprisedb.com>
From: Mithun Cy <mithun.cy@enterprisedb.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Peter van Hardenberg <pvh@pvh.ca>, Peter Eisentraut <peter_e@gmx.net>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2016-11-01T13:43:35Z
Lists: pgsql-hackers
On Tue, Nov 1, 2016 at 6:54 PM, Robert Haas <robertmhaas@gmail.com> wrote: >That's the wrong syntax. If you look in > https://www.postgresql.org/docs/devel/static/libpq-connect.html under > "32.1.1.2. Connection URIs", it gives an example of how to include a > slash in a pathname. You have to use %2F, or else the URL parser will > think you're starting a new section of the URI. >I believe this works fine if you use the correct syntax. Sorry that was a mistake from me. Now it appears fine. > > Starting program: /home/mithun/libpqbin/bin/./psql > postgres://%2fhome%2fmithun:5555/postgres -U mithun1 > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib64/libthread_db.so.1". > psql: could not connect to server: No such file or directory > Is the server running locally and accepting > *connections on Unix domain socket "/home/mithun/.s.PGSQL.5555"*? Accidentally when testing further on this line I found a crash when invalid encoding "%2" (not recognised as hexa) was used. Test: > Starting program: /home/mithun/libpqbin/bin/*./psql > postgres://%2home%2mithun:5555/postgres -U mithun1* [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". > Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7bb8d4f in PQpass (conn=0x68aaa0) at fe-connect.c:5582 5582 password = conn->connhost[conn->whichhost].password; Missing separate debuginfos, use: debuginfo-install > glibc-2.17-106.el7_2.6.x86_64 ncurses-libs-5.9-13.20130511.el7.x86_64 > readline-6.2-9.el7.x86_64 There can be PGconn which have no connhost. exposed API's PQpass, PQreset->connectDBStart access conn->connhost without checking whether it is set. >That output seems fine to me. In a real connection string, you're not >likely to have so many duplicated addresses, and it's good for the >error message to make clear which addresses were tried and what >happened for each one. Agree, Thanks. -- Thanks and Regards Mithun C Y EnterpriseDB: http://www.enterprisedb.com
Commits
-
libpq: Add target_session_attrs parameter.
- 721f7bd3cbcc 10.0 landed
-
Remove superuser checks in pgstattuple
- fd321a1dfd64 10.0 cited
-
Fix unwanted flushing of libpq's input buffer when socket EOF is seen.
- c405918858c0 9.6.0 cited