How to discard partially retrieved result set with the C API?
How to discard partially retrieved result set with the C API?
От:
邓尧 <torshie@gmail.com>
Дата:
When single row mode is enabled, after retrieving part of the result set, I'm no longer interested in the rest of it (due to error handling or other reasons). How can I discard the result set without repeatedly calling PQgetResult() in such situation ?
The result set may be quite large and it's inefficient to call PQgetResult() repeatedly, so it's necessary to do so sometimes.
ThanksThe result set may be quite large and it's inefficient to call PQgetResult() repeatedly, so it's necessary to do so sometimes.
Yao
Re: How to discard partially retrieved result set with the C API?
От:
Dmitriy Igrishin <dmitigr@gmail.com>
Дата:
2014-02-18 13:44 GMT+04:00 邓尧 <torshie@gmail.com>:
I think you should use PQcancel().When single row mode is enabled, after retrieving part of the result set, I'm no longer interested in the rest of it (due to error handling or other reasons). How can I discard the result set without repeatedly calling PQgetResult() in such situation ?Thanks
The result set may be quite large and it's inefficient to call PQgetResult() repeatedly, so it's necessary to do so sometimes.
Yao
// Dmitriy.
Re: How to discard partially retrieved result set with the C API?
От:
Pavel Stehule <pavel.stehule@gmail.com>
Дата:
2014-02-18 11:53 GMT+01:00 Dmitriy Igrishin <dmitigr@gmail.com>:
2014-02-18 13:44 GMT+04:00 邓尧 <torshie@gmail.com>:I think you should use PQcancel().When single row mode is enabled, after retrieving part of the result set, I'm no longer interested in the rest of it (due to error handling or other reasons). How can I discard the result set without repeatedly calling PQgetResult() in such situation ?Thanks
The result set may be quite large and it's inefficient to call PQgetResult() repeatedly, so it's necessary to do so sometimes.
Yao
is not better to use a cursor for this use case?
Pavel
--
// Dmitriy.