Thanks for the documentation link. It helped me to understand how data are
passed back to the client.
I figured out that data is sent back to the client using the 'printtup'
function. It is called by ExecSelect, called by ExecutorRun, etc. What I
understand now is that the data is sent to the client and stored there until
the client receives a message from the server to display it. The server
sends the display message from within 'ReadyForQuery' but I can't figure it
out.
What I expect is that when I call 'exec_simple_query' several times, the
server sends one row only for each call. But since they are separate calls,
the client overwrites the previous results or saves the new row in a new
place in memory such that it displays the last row only when the server
invokes 'ReadyForQuery'.
I wonder if I am on the right track or not and how to know such kind of
message sent from the server?
Regards
Islam Hegazy
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Islam Hegazy" <islheg@gmail.com>
Cc: <pgsql-hackers@postgresql.org>
Sent: Tuesday, April 17, 2007 1:44 AM
Subject: Re: [HACKERS] modifying the table function
> "Islam Hegazy" <islheg@gmail.com> writes:
>> My question is how to inform the client that there is a tuple to display
>> =
>> and return back to the backend to continue the query execution?
>
> I'd suggest you start by reading
> http://developer.postgresql.org/pgdocs/postgres/protocol.html
> and then develop a clear specification at that level of what you
> think should happen. Perhaps after that exercise it will be clearer
> how to change the code. "Think first, program later."
>
> regards, tom lane