Re: Exception Handling in C-Language Functions?

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Exception Handling in C-Language Functions?
Дата
Msg-id 428F09B9.6080806@samurai.com
обсуждение исходный текст
Ответ на Exception Handling in C-Language Functions?  ("Felix E. Klee" <felix.klee@inka.de>)
Ответы Re: Exception Handling in C-Language Functions?  ("Felix E. Klee" <felix.klee@inka.de>)
Список pgsql-general
Felix E. Klee wrote:
> I have the created a C-Language function (code is below).  Now, I
> wonder: How do I handle exceptions, for example if malloc cannot assign
> the necessary memory?  Do "palloc" and "pfree" handle such a case
> cleanly?

Yes -- they will roll back the current transaction on if there is no
memory available. You can catch the error via PG_TRY() in 8.0, although
in the case of OOM there isn't probably a lot your exception handler
could do...

-Neil

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

Предыдущее
От: "Felix E. Klee"
Дата:
Сообщение: Exception Handling in C-Language Functions?
Следующее
От: "Felix E. Klee"
Дата:
Сообщение: Re: Exception Handling in C-Language Functions?