Re: Question about error handling with UDF written in C

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question about error handling with UDF written in C
Дата
Msg-id 10878.1363723501@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Question about error handling with UDF written in C  (Terry Chong <198back@gmail.com>)
Список pgsql-novice
Terry Chong <198back@gmail.com> writes:
> My question is that if we detect an error at line 15 and we get into the
> ereport code, would the memory allocated under multi_call_memory_ctx gets
> cleaned up properly?

Yes, it would.  That's just the executor's query context, or maybe a
subcontext thereof, so it'll go away when the query is abandoned.

By and large, functions following ordinary coding conventions don't need
to worry about resource cleanup on error.  The exception would be if you
were holding open file descriptors or some such that the core system
didn't know about.

            regards, tom lane


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

Предыдущее
От: Terry Chong
Дата:
Сообщение: Question about error handling with UDF written in C
Следующее
От: simonyanderson
Дата:
Сообщение: Re: How to Recover iPhone Contacts You Lost Somehow?