

Hi all,

I'm playing with this for one week with no luck... :(

I'm implementing the 3.0 protocol version in Npgsql, a .Net Data 
provider for postgresql.


I could get it working using the simple query and so, I started to work 
in the extended query.

I stopped in the first message: Parse :(

I send the parse message but I don't receive the ParseComplete or the 
ErrorResponse. My code simply freezes while reading the byte from 
network stream.

I added some elog lines to check that I was sending the message 
correctly. I could even check that pq_putemptymessage('1') is being 
called in the exec_parse_message() method, but I don't know why I'm 
getting blocked when reading the data.


It is strange because all the simple query mode tests I did work very 
well. Just this Parse message isn't working for me.

Am I missing something?


I'm using the latest cvs code on cygwin.


Thanks in advance.



-- 
Regards,

Francisco Figueiredo Jr.

------
"My grandfather once told me that there are two
kinds of people: those
who work and those who take the credit. He told me
to try to be in the
first group; there was less competition there."
- Indira Gandhi


Sat, 28 Jun 2003 02:12:22 -0300
"Francisco Figueiredo Jr." <fxjrlists@yahoo.com.br>
Getting blocked when receinving response from a Parse message...
"Francisco Figueiredo Jr." <fxjrlists@yahoo.com.br> writes:
> I'm implementing the 3.0 protocol version in Npgsql, a .Net Data 
> provider for postgresql.

> I stopped in the first message: Parse :(
> I send the parse message but I don't receive the ParseComplete or the 
> ErrorResponse. My code simply freezes while reading the byte from 
> network stream.

You must send either Flush or Sync after the Parse to force the backend
to emit its response to Parse.  The assumption is that in many cases
you'll be sending Parse as part of a batch of commands, and the backend
should batch its responses to minimize the number of network packets
sent.  So you have to tell it where the batch boundaries are --- thus,
Flush or Sync.  See the docs concerning the difference between the two.

			regards, tom lane

Sat, 28 Jun 2003 01:34:18 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: Getting blocked when receinving response from a Parse message... 
Tom Lane wrote:
> "Francisco Figueiredo Jr." <fxjrlists@yahoo.com.br> writes:
> 
>>I'm implementing the 3.0 protocol version in Npgsql, a .Net Data 
>>provider for postgresql.
> 
> 
>>I stopped in the first message: Parse :(
>>I send the parse message but I don't receive the ParseComplete or the 
>>ErrorResponse. My code simply freezes while reading the byte from 
>>network stream.
> 
> 
> You must send either Flush or Sync after the Parse to force the backend
> to emit its response to Parse.  The assumption is that in many cases
> you'll be sending Parse as part of a batch of commands, and the backend
> should batch its responses to minimize the number of network packets
> sent.  So you have to tell it where the batch boundaries are --- thus,
> Flush or Sync.  See the docs concerning the difference between the two.
> 

Oohh, thanks, Tom Lane!
I didn't read carefully the final part of extended query where it says 
about the Flush message :)

I didn't realize the idea of holding responses to minimize network 
traffic. I was thinking in the send reply style :)


-- 
Regards,

Francisco Figueiredo Jr.

------
"My grandfather once told me that there are two
kinds of people: those
who work and those who take the credit. He told me
to try to be in the
first group; there was less competition there."
- Indira Gandhi


Sat, 28 Jun 2003 22:54:11 -0300
"Francisco Figueiredo Jr." <fxjrlists@yahoo.com.br>
Re: Getting blocked when receinving response from a Parse