On Fri, Dec 30, 2016 at 3:48 AM, Peter Eisentraut <peter.eisentr...@2ndquadrant.com> wrote: > On 12/16/16 10:38 AM, Andrew Borodin wrote: >> 2016-12-16 20:17 GMT+05:00 Peter Eisentraut >> <peter.eisentr...@2ndquadrant.com>: >>>> And one more thing... Can we have BackgroundSessionExecute() splitted >>>> into two parts: start query and wait for results? >>>> It would allow pg_background to reuse bgsession's code. >>> >>> Yes, I will look into that. >> >> Thank you. I'm marking both patches as "Waiting for author", keeping >> in mind that pg_background is waiting for bgsessions. >> After updates I'll review these patches. > > New patch, mainly with the function split as you requested above, not > much else changed. >
Thanks for your v2 patch, this is really helpful. One more requirement for pg_background is session, command_qh, response_qh and worker_handle should be last longer than current memory context, for that we might need to allocate these in TopMemoryContext. Please find attach patch does the same change in BackgroundSessionStart(). Do let me know if you have any other thoughts/suggestions, thank you. Regards, Amul
BackgroundSessionStart.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers