Обсуждение: elog and MemoryContextSwitchTo

Поиск
Список
Период
Сортировка

elog and MemoryContextSwitchTo

От
Gaetano Mendola
Дата:
Hi all,

Is the following code well formed?

oldContext = MemoryContextSwitchTo(newContext);
....
if (something_bad) {  elog(ERROR, ...);
}
...
MemoryContextSwitchTo(oldContext);


or do I have to ripristinate the oldContext before to issue the elog ?



Regards
Gaetano Mendola



Re: elog and MemoryContextSwitchTo

От
Tom Lane
Дата:
Gaetano Mendola <mendola@gmail.com> writes:
> or do I have to ripristinate the oldContext before to issue the elog ?

No.
        regards, tom lane