Fdw cleanup

Поиск
Список
Период
Сортировка
От Feng Tian
Тема Fdw cleanup
Дата
Msg-id CAFWGqnsPq0bjmVP6O8KGmFXN3_4HC_tHAbrPpYbP1JvS9VNZdA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fdw cleanup  (Albe Laurenz <laurenz.albe@wien.gv.at>)
Список pgsql-hackers
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 well, ExecEndForeignScan will call call my EndForeignScan hook, inside the hook, I free the resource.

free_resource(node->fdw_state);

However, if during the execution an error happened, seems to me that EndForeignScan will not be called (traced using gdb).   So my question is, is Begin/End the right place for allocate/free resources?   If it is not, what is the right way to do this?

Thank you very much,
Feng
   

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Proposal: custom compression methods
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: [PATCH] Logical decoding support for sequence advances