modifying the table function

Поиск
Список
Период
Сортировка
От Islam Hegazy
Тема modifying the table function
Дата
Msg-id 000a01c780bf$42163910$0200a8c0@islheg
обсуждение исходный текст
Ответы Re: modifying the table function  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Marko Kreen"
Дата:
Сообщение: Re: RESET command seems pretty disjointed now
Следующее
От: Tom Lane
Дата:
Сообщение: Re: modifying the table function