Re: Speed dblink using alternate libpq tuple storage
От | Kyotaro HORIGUCHI |
---|---|
Тема | Re: Speed dblink using alternate libpq tuple storage |
Дата | |
Msg-id | 20120227.172030.48560991.horiguchi.kyotaro@oss.ntt.co.jp обсуждение исходный текст |
Ответ на | Re: Speed dblink using alternate libpq tuple storage (Marko Kreen <markokr@gmail.com>) |
Ответы |
Re: Speed dblink using alternate libpq tuple storage
|
Список | pgsql-hackers |
Hello, > 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 exitimmediately. - pqParseInput3 set conn->asyncStatus to PGASYNC_BREAK for the last case, - 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 isbreaked. > Instead use ("%s", errmsg) as argument there. libpq code > is noisy enough, no need to add more. Ok. I will do so. regards, -- Kyotaro Horiguchi NTT Open Source Software Center
В списке pgsql-hackers по дате отправления: