Re: Patch: Implement failover on libpq connect level.

Поиск
Список
Период
Сортировка
От Mithun Cy
Тема Re: Patch: Implement failover on libpq connect level.
Дата
Msg-id CAD__OuihR7Ws54wnFYg_q9O49DreLX=8Ba1ybnnJtg3RHJzZOg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Patch: Implement failover on libpq connect level.  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Patch: Implement failover on libpq connect level.  (Robert Haas <robertmhaas@gmail.com>)
Список 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
> "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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: emergency outage requiring database restart
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Improve output of BitmapAnd EXPLAIN ANALYZE