Re: Extended Query, flush or sync ?

From: Raimon Fernandez <coder(at)montx(dot)com>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: pgsql-general List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Extended Query, flush or sync ?
Date: 2009-12-22 16:09:52
Message-ID: 8B2FDB4A-81E9-4307-8652-4C56EEAD2B18@montx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces


On 19/12/2009, at 16:32, John DeSoi wrote:

>> If I execute with a row limit of 1000, and I know there are more than 1000 rows, I get the portalSuspended as described.
>>
>> But, If a issue a new Execute, postgresql says that myPortal doesn't exist anymore.
>>
>> How I can get those 1000 rows ?
>
> Are you using a named portal? Are you reading all responses until you receive a ready for query response? There are a lot of details - it really helped me to look at the psql source.

Yes, I'm using a named portal.

The new question is:

When I get the PortalSuspended, I get the 1000 rows, and for fetching the others, I have to send a new Execute to the same Portal:

"If Execute terminates before completing the execution of a portal (due to reaching a nonzero result- row count), it will send a PortalSuspended message; the appearance of this message tells the frontend that another Execute should be issued against the same portal to complete the operation. "

But the portal isn't destroyed after a sync ?

I'm getting a "Portal 'myPortal' doesn't exist "when sending the next Execute ...

1. Parse the Select with some $1, $2

2. Send a Bind + Describe + Execute + Sync

3. received the portalSuspended

4. Send the Execute

5. Receive the error "Portal 'myPortal' doesn't exist "

thanks,

regards,

raimon

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nathaniel Trellice 2009-12-22 17:09:55 libpq: do I need PQendcopy after PQgetCopyData?
Previous Message Raimon Fernandez 2009-12-22 16:01:34 Extended Query vs Simple Query

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2009-12-22 17:15:55 Re: Extended Query, flush or sync ?
Previous Message Raimon Fernandez 2009-12-22 16:01:34 Extended Query vs Simple Query