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

From John DeSoi
Subject Re: Cancelling Requests Frontend/Backend Protocol TCP/IP
Date
Msg-id 1C213511-12C8-44F9-A33C-3033826133F3@pgedit.com
Whole thread Raw
In response to Re: Cancelling Requests Frontend/Backend Protocol TCP/IP  (Raimon Fernandez <coder@montx.com>)
Responses Re: Cancelling Requests Frontend/Backend Protocol TCP/IP  (Raimon Fernandez <coder@montx.com>)
List pgsql-general
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.



John DeSoi, Ph.D.





pgsql-general by date:

Previous
From: CaT
Date:
Subject: Re: Absolute value of intervals
Next
From: Merlin Moncure
Date:
Subject: Re: array_reverse()