Re: Extended Query, flush or sync ? - Mailing list pgsql-general

From Raimon Fernandez
Subject Re: Extended Query, flush or sync ?
Date
Msg-id 201B449B-118E-43A6-A413-4709A8FD463C@montx.com
Whole thread Raw
In response to Re: Extended Query, flush or sync ?  (John DeSoi <desoi@pgedit.com>)
Responses Extended Query vs Simple Query  (Raimon Fernandez <coder@montx.com>)
List pgsql-general
Hi John,


I'm not seeing my e-mails on the PostgreSQL General List ...

??????

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

>
> On Dec 19, 2009, at 2:40 AM, Raimon Fernandez wrote:
>
>>> I send:
>>>
>>> parse
>>> bind
>>> describe
>>> execute
>>> sync
>>>
>>> and then loop on the connection stream to receive the responses.
>>
>> And do you get the parseComplete after sending the parse or after sending the sync ?
>
> I don't really know or care. I send the entire sequence above and then read the results handling each possible case.
Inother words, I don't read anything after each message; I only read after sending the sync. 

I see, I don't know why I was sending each command in a separate communication, I can pack all of them and send them at
thesame time, except de Parse, that will go at the connection beggining in my case. 


>> And also from the docs:
>>
>> "If Execute terminates before completing the execution of a portal (due to reaching a nonzero result- row count), it
willsend a PortalSuspended message; t 
>> he appearance of this message tells the frontend that another Execute should be issued against the same portal to
completethe operation. " 
>>
>> 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
lotof details - it really helped me to look at the psql source. 

I'm using Portals with my own name, I'll give a shot later ...

thanks !

regards,

r.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Extended Query, flush or sync ?
Next
From: Pavel Stehule
Date:
Subject: Re: defining yuor own commands in PG ?