From: | "Islam Hegazy" <islheg(at)gmail(dot)com> |
---|---|
To: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | modifying the table function |
Date: | 2007-04-17 07:08:37 |
Message-ID: | 000a01c780bf$42163910$0200a8c0@islheg |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi there
I made some changes in postgresql source code to let the table function work in iteration fashion rather than materialization fashion. My main modifications are in 'exec_simple_query' function, I changed 'portalRunSelect' to return just one tuple instead of 'FETCH_ALL'. I made other variables static as the 'portal', 'receiver', etc. so that the program returns to them to continue execution from the last point.
Then I added more calls to 'exec_simple_query' and it worked correctly. For example, if I added 4 calls to 'exec_simple_query' the 4th tuple is returned. My problem lies now in how to display the 1st, 2nd, 3rd tuples not just the 4th. I tried to call 'pq_flush' after each 'exec_simple_query' but nothing is displayed. I replaced 'pq_flush' with 'ReadyForQuery' but it gives the following error 'error 0x54 message received while system is idle'.
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?
Regards
Islam Hegazy
From | Date | Subject | |
---|---|---|---|
Next Message | Zoltan Boszormenyi | 2007-04-17 07:15:34 | Re: [HACKERS] Re: IDENTITY/GENERATED v36 Re: Final version of IDENTITY/GENERATED patch |
Previous Message | Marko Kreen | 2007-04-17 07:03:50 | Re: RESET command seems pretty disjointed now |