Re: walreceiver is uninterruptible on win32
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Magnus Hagander <magnus@hagander.net>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Joe Conway <mail@joeconway.com>
Date: 2010-04-17T01:47:00Z
Lists: pgsql-hackers
On Fri, Apr 16, 2010 at 3:03 AM, Fujii Masao <masao.fujii@gmail.com> wrote: > On Thu, Apr 15, 2010 at 11:26 PM, Robert Haas <robertmhaas@gmail.com> wrote: >> I have to admit to finding this confusing. According to the comments: >> >> + /* >> + * Don't emulate the PQexec()'s behavior of returning the last >> + * result when there are many, since walreceiver never sends a >> + * query returning multiple results. >> + */ >> >> ...but it looks like the code actually is implementing some sort of >> loop-that-returns-the-last result. > > Yeah, it's not a very accurate description. And I found another problem: > libpqrcv_PQexec() ends as soon as an error result arrives even if its > state has not been PGASYNC_IDLE yet. > > So I changed libpqrcv_PQexec() so that it emulates the PQexec()'s behavior > except the concatenation of error messages. How about the attached patch? Well, the comment definitely makes more sense in this version. I can't speak to the behavior. ...Robert