Re: BUG #14544: libpq: specifying 'target_session_attrs=read-write' prevents use of PQsendQuery

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: jordal(at)amazon(dot)com
Cc: PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14544: libpq: specifying 'target_session_attrs=read-write' prevents use of PQsendQuery
Date: 2017-02-14 05:09:08
Message-ID: CAB7nPqT22d_kty+3LMvpem392sTPjjc8Z0dDWVk77E8VjYimgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Feb 14, 2017 at 4:43 AM, <jordal(at)amazon(dot)com> wrote:
> Repro steps:
> 1. Establish a connection with PQconnectdb and ensure you add
> “target_session_attrs=read-write” to the connection string
> 2. Try to submit a query using PQsendQuery on the returned connection
> object
> 3. PQsendQuery fails, and the error message gets set to “another command is
> already in progress”
>
> Reference libpq doc that says PQgetResult must be called until it returns
> NULL: https://www.postgresql.org/docs/current/static/libpq-async.html.

That's a known problem, discussed here as well:
https://www.postgresql.org/message-id/flat/1803D792815FC24D871C00D17AE95905AC5FAE(at)g01jpexmbkw24#1803D792815FC24D871C00D17AE95905AC5FAE@g01jpexmbkw24
And there is a patch.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message John R Pierce 2017-02-14 05:47:22 Re: BUG #14541: Getting error while installation
Previous Message Andres Freund 2017-02-14 04:27:48 Re: BUG #14231: logical replication wal sender process spins when using error traps in function