Re: [HACKERS] Fdw cleanup

2015-12-14 Thread Feng Tian
Hi, Albe, Thank you. The resource is not memory, I have something like a file descriptor or network connection, which I believe is the common case for foreign table. Using RegisterXactCallback exposes an API at a much deep level to foreign table writer, and I need to find a place to anchor the

Re: [HACKERS] Fdw cleanup

2015-12-14 Thread Albe Laurenz
Feng Tian wrote: > I need some help to understand foreign table error handling. > > For a query on foreign table, ExecInitForeignScan is called, which in turn > calls the BeginForeignScan > hook. Inside this hook, I allocated some resource, > > > node->fdw_state = allocate_resource(...); >

[HACKERS] Fdw cleanup

2015-12-13 Thread Feng Tian
Hi, Hackers, I need some help to understand foreign table error handling. For a query on foreign table, ExecInitForeignScan is called, which in turn calls the BeginForeignScan hook. Inside this hook, I allocated some resource, node->fdw_state = allocate_resource(...); If everything goes