"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