Re: modifying the table function

From: "Islam Hegazy" <islheg(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: modifying the table function
Date: 2007-04-18 22:01:46
Message-ID: 035e01c78209$22c76d40$0d0e9f88@pc.cpsc.ucalgary.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)sss(dot)pgh(dot)pa(dot)us>
To: "Islam Hegazy" <islheg(at)gmail(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Sent: Tuesday, April 17, 2007 1:44 AM
Subject: Re: [HACKERS] modifying the table function

> "Islam Hegazy" <islheg(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martin Langhoff 2007-04-18 22:07:08 Re: Hacking on PostgreSQL via GIT
Previous Message Alvaro Herrera 2007-04-18 21:46:56 Remaining VACUUM patches