Re: [PATCHES] COPY when 'filename' is a directory

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brent Verner <brent(at)rcfile(dot)org>, Douglas Trainor <trainor(at)uic(dot)edu>, pgsql-bugs(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCHES] COPY when 'filename' is a directory
Date: 2002-02-24 02:31:35
Message-ID: 200202240231.g1O2VZ304266@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-patches

Tom Lane wrote:
> Brent Verner <brent(at)rcfile(dot)org> writes:
> > | This coding is WRONG. You do not use fclose() to release a file
> > | opened with AllocateFile.
>
> > s/fclose/FreeFile/
>
> Actually, my recommendation is to remove it altogether. The mechanisms
> are in place to close allocated files after elog(), so why waste thought
> and code space to release them manually?

Fix applied. There is a FileFree() just below this in the code:

if (!pipe)
FreeFile(fp);

We don't need the if (!pipe) because this code is in an else of
if(pipe). For clarity, it seems the FreeFile call makes sense.

The psql/copy.c file is fine because it isn't backend code.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 1.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-02-24 02:41:28 Re: [PATCHES] COPY when 'filename' is a directory
Previous Message Tom Lane 2002-02-24 02:11:03 Re: [PATCHES] COPY when 'filename' is a directory

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-02-24 02:41:28 Re: [PATCHES] COPY when 'filename' is a directory
Previous Message Tom Lane 2002-02-24 02:11:03 Re: [PATCHES] COPY when 'filename' is a directory