Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-26 Thread Michael Paquier
On Mon, Feb 27, 2017 at 3:12 AM, Robert Haas wrote: > Thanks! Committed. Thanks. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-26 Thread Robert Haas
On Mon, Feb 20, 2017 at 11:52 AM, Michael Paquier wrote: > On Thu, Feb 16, 2017 at 10:55 AM, Michael Paquier > wrote: >> It is possible to get a test easily in this area by abusing of the >> fact that multiple -d switches defined in psql make

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-19 Thread Michael Paquier
On Thu, Feb 16, 2017 at 10:55 AM, Michael Paquier wrote: > It is possible to get a test easily in this area by abusing of the > fact that multiple -d switches defined in psql make it use only the > last value. By looking at psql() in PostgresNode.pm you would see what >

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-15 Thread Michael Paquier
On Thu, Feb 16, 2017 at 1:08 AM, Robert Haas wrote: > Great, thanks! This looks good to me, so committed. Thanks. > Is there any > chance you can use your amazing TAP-test-creation powers to do some > automated testing of this feature? For example, maybe we could at >

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-15 Thread Robert Haas
On Wed, Feb 15, 2017 at 1:31 AM, Michael Paquier wrote: > On Wed, Feb 15, 2017 at 11:08 AM, Robert Haas wrote: >> I think the patch as presented probably isn't quite what we want, >> because it waits synchronously for the second result to be

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-14 Thread Michael Paquier
On Wed, Feb 15, 2017 at 11:08 AM, Robert Haas wrote: > I think the patch as presented probably isn't quite what we want, > because it waits synchronously for the second result to be ready. > Note that the wait for the first result is asynchronous: we check > PQisBusy and

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-14 Thread Robert Haas
On Tue, Feb 14, 2017 at 12:11 AM, Michael Paquier wrote: > On Thu, Feb 2, 2017 at 3:01 PM, Higuchi, Daisuke > wrote: >> From: Michael Paquier [mailto:michael.paqu...@gmail.com] >>>This has not been added yet to the next CF. As Ashutosh

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-13 Thread Michael Paquier
On Thu, Feb 2, 2017 at 3:01 PM, Higuchi, Daisuke wrote: > From: Michael Paquier [mailto:michael.paqu...@gmail.com] >>This has not been added yet to the next CF. As Ashutosh mentioned >>things tend to be easily forgotten. So I have added it here:

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Higuchi, Daisuke
From: Michael Paquier [mailto:michael.paqu...@gmail.com] >This has not been added yet to the next CF. As Ashutosh mentioned >things tend to be easily forgotten. So I have added it here: >https://commitfest.postgresql.org/13/982/ Thank you for adding this problem to CF. > I have noticed this

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Higuchi, Daisuke
From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com] >Sorry, attached wrong patch. Here's the right one. > The code expects that there will be two PQgetResult() calls required. > One to fetch the result of SHOW command and the other to extract NULL. > If we require more calls or

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Michael Paquier
On Thu, Feb 2, 2017 at 1:34 PM, Ashutosh Bapat wrote: > On Thu, Feb 2, 2017 at 10:04 AM, Ashutosh Bapat > wrote: >> [1] https://www.postgresql.org/docs/devel/static/libpq-exec.html: >> PQgetvalue(). > The code expects that there

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
Sorry, attached wrong patch. Here's the right one. On Thu, Feb 2, 2017 at 10:04 AM, Ashutosh Bapat wrote: > On Thu, Feb 2, 2017 at 8:11 AM, Higuchi, Daisuke > wrote: >> From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com]

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
On Thu, Feb 2, 2017 at 8:11 AM, Higuchi, Daisuke wrote: > From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com] >> Per the documentation [1], "PQgetResult must be called repeatedly >> until it returns a null pointer, indicating that the command is >>

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Higuchi, Daisuke
From: Ashutosh Bapat [mailto:ashutosh.ba...@enterprisedb.com] > Per the documentation [1], "PQgetResult must be called repeatedly > until it returns a null pointer, indicating that the command is > done.". The code in PQgetResult() under CONNECTION_CHECK_WRITABLE > case, violates that. The patch

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
Please add this to the next commitfest, so that we don't forget it. On Wed, Feb 1, 2017 at 3:58 PM, Ashutosh Bapat wrote: > On Tue, Jan 31, 2017 at 9:53 AM, Higuchi, Daisuke > wrote: >> Hello, >> >> This this is my first posting

Re: [HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-02-01 Thread Ashutosh Bapat
On Tue, Jan 31, 2017 at 9:53 AM, Higuchi, Daisuke wrote: > Hello, > > This this is my first posting to the mailing list. > > I am interested in multiple hosts of libpq [1], then I found the bug in this > feature. > When I set "target_session_attrs" to "any" and

[HACKERS] [Bug fix] PQsendQuery occurs error when target_session_attrs is set to read-write

2017-01-31 Thread Higuchi, Daisuke
Hello, This this is my first posting to the mailing list. I am interested in multiple hosts of libpq [1], then I found the bug in this feature. When I set "target_session_attrs" to "any" and call PQsendQuery, my application is succeeded. However, when I set "target_session_attrs" to