Re: How to discard partially retrieved result set with the C API?

From: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
To: 邓尧 <torshie(at)gmail(dot)com>
Cc: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to discard partially retrieved result set with the C API?
Date: 2014-02-18 10:53:39
Message-ID: CAAfz9KNmqLBmnvWaSBJ90Tk7a2ZWuH4nKsrzP6E7vbM=umc2-Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2014-02-18 13:44 GMT+04:00 邓尧 <torshie(at)gmail(dot)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.
>
> Thanks
> Yao
>
I think you should use PQcancel().

--
// Dmitriy.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2014-02-18 11:28:16 Re: How to discard partially retrieved result set with the C API?
Previous Message 邓尧 2014-02-18 09:44:10 How to discard partially retrieved result set with the C API?