> On OOM, the old result is freed to have higher chance that
> constructing new result succeeds. But if we want to transport
> error message, we need to keep old PGresult around. Thus
> two separate paths.
Ok, I understood the aim. But now we can use non-local exit to do
that for not only asynchronous reading (PQgetResult()) but
synchronous (PQexec()). If we should provide a means other than
exceptions to do that, I think it should be usable for both
syncronous and asynchronous reading. conn->asyncStatus seems to
be used for the case.
Wow is the modification below?
- getAnotherTuple() now returns 0 to continue as before, and 1
instead of EOF to signal EOF state, and 2 to instruct to exit
- pqParseInput3 set conn->asyncStatus to PGASYNC_BREAK for the
- then PQgetResult() returns immediately when
asyncStatus == PGASYNC_TUPLES_BREAK after parseInput() retunes.
- and PQexecFinish() returns immediately if PQgetResult() returns
with aysncStatys == PGASYNC_TUPLES_BREAK.
- PGgetResult() sets asyncStatus = PGRES_TUPLES_OK if called with
asyncStatus == PGRES_TUPLES_BREAK
- New libpq API PQisBreaked(PGconn*) returns if asyncStatus ==
PGRES_TUPLES_BREAK can be used to check if the transfer is breaked.
> Instead use ("%s", errmsg) as argument there. libpq code
> is noisy enough, no need to add more.
Ok. I will do so.
NTT Open Source Software Center
In response to
pgsql-hackers by date
|Next:||From: Simon Riggs||Date: 2012-02-27 08:50:34|
|Subject: Re: Initial 9.2 pgbench write results|
|Previous:||From: Koichi Suzuki||Date: 2012-02-27 08:16:42|
|Subject: Re: 3rd Cluster Hackers Summit, May 15th in