elog and MemoryContextSwitchTo

Started by Gaetano Mendolaalmost 14 years ago2 messages
#1Gaetano Mendola
mendola@gmail.com

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Gaetano Mendola (#1)
Re: elog and MemoryContextSwitchTo

Gaetano Mendola <mendola@gmail.com> writes:

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

No.

regards, tom lane