Re: PostgreSQL under BSD/OS - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: PostgreSQL under BSD/OS
Date
Msg-id 199808291722.NAA10448@candle.pha.pa.us
Whole thread Raw
In response to Re: PostgreSQL under BSD/OS  (Greg Black <gjb@acm.org>)
List pgsql-hackers
> > OK, in pgsql/src/backend/command/copy.c, you should see a function call
> > to FreeFile().  That is what is supposed to be called to free the open
> > file.  AllocateFile opens the file a few lines above it, in either read
> > or write mode.
> >
> > If you can, can you put a little printf statement just before the
> > FreeFile, and see if it is getting called.  You have to look in the
> > postmaster log file to see the output of the printf().  If it is getting
> > called, I have no idea why it would still be holding the file
> > descriptor.  If it is not calling that function, I am confused because I
> > can't see how it could get out of that function without calling it.
>
> I'm willing to have a look at this in a few weeks, but I don't have time
> to do it now.  I'll get back to you when I've got some additional info.

I am going to add some code to copy.c so if COPY is called again, and
the file descriptor was not closed because of an error somewhere deep in
the code, it will close the descriptor before opening a new one.  Should
prevent file descriptor leaking.


--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] odd pg_dump output?
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] IP data type