Thread: Re: [HACKERS] DROP TABLE leaks file descriptors

Re: [HACKERS] DROP TABLE leaks file descriptors

From
Tom Lane
Date:
Bruce Momjian <maillist@candle.pha.pa.us> writes:
>>>> But it is still true that DROP TABLE leaves a virtual
>>>> file descriptor open for each index on the dropped table, and that's
>>>> a bug in my book.
>>
>> AFAIC the patch by Ole Gjerde [gjerde@icebox.org] which has already 
>> been appiled by Bruce Momjan would solve this problem. 

> I thought that patch was just for multi-segment tables, which does not
> fix the original problem.

But didn't Ole replace a call to FileNameUnlink with a call to mdunlink
(or some other higher level routine)?  If mdunlink also closes the VFD
for the index, then that patch might indeed have fixed it.  I'll try
the test case I had, and report back.
        regards, tom lane