Re: Cancelling Requests Frontend/Backend Protocol TCP/IP - Mailing list pgsql-general

From Raimon Fernandez
Subject Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
Date
Msg-id B2669399-BFFF-49E4-9038-C218A35F7BD5@montx.com
Whole thread Raw
In response to Re: Cancelling Requests Frontend/Backend Protocol TCP/IP  (John DeSoi <desoi@pgedit.com>)
List pgsql-general
On 02/11/2009, at 15:12, John DeSoi wrote:

>
> On Nov 2, 2009, at 4:15 AM, Raimon Fernandez wrote:
>
>> If for example I send  a SELECT * from myTable, it has 20000 rows,
>> and postgre starts sending the rows, how I can cancel this
>> operation ?
>>
>> I thought Cancelling Requests would be perfect for this ... the
>> workaround is closing and opening again the connection but I don't
>> like this approach ...
>
> A cleaner solution is to use the extended query protocol to limit
> the total number of rows returned. For example, in my application I
> limit the result set to 1000 rows. I have not received all of the
> results, I switch to a server side cursor but still have the first
> 1000 rows for immediate display to the end user.

This is another option, but at least I want to make it to work the
CancelRequest ...

:-)

As an experiment, I'm doing with LIMIT and OFFSET instead of cursors
at this moment ...

thanks,


regards,


raimon


pgsql-general by date:

Previous
From: Raimon Fernandez
Date:
Subject: Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
Next
From: Tom Lane
Date:
Subject: Re: Cancelling Requests Frontend/Backend Protocol TCP/IP