ereport(ERROR) and files

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

ereport(ERROR) and files

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Do we automatically close files opened with AllocateFile() on
ereport(ERROR)?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610) 359-1001 +  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: ereport(ERROR) and files

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:
Bruce Momjian wrote:
> Do we automatically close files opened with AllocateFile() on
> ereport(ERROR)?

I found they are closed, fd.c comment says:
* fd.c will automatically close all files opened with AllocateFile at* transaction commit or abort; this prevents FD leakage if a routine* that calls AllocateFile is terminated prematurely by ereport(ERROR).

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610) 359-1001 +  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: ereport(ERROR) and files

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Bruce Momjian  writes:
> Do we automatically close files opened with AllocateFile() on
> ereport(ERROR)?

Yes ... that's more or less the point of having it ...
		regards, tom lane

FAQ