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

2002-02-23 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I should have said "in the _new_ code" above. Ah, my mistake. I was looking at the original coding. > Agreed. However, I have never seen it stated that file descriptors are > freeded on elog(ERROR). I certainly didn't know that. If we are going > t

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

2002-02-23 Thread Bruce Momjian
Tom Lane wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > >> 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 FileF

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

2002-02-23 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: >> 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

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

2002-02-23 Thread Bruce Momjian
Tom Lane wrote: > Brent Verner <[EMAIL PROTECTED]> 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 allocat

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

2002-02-23 Thread Tom Lane
Brent Verner <[EMAIL PROTECTED]> 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 wa

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

2002-02-23 Thread Bruce Momjian
Brent Verner wrote: > [2002-02-23 20:27] Tom Lane said: > | Bruce Momjian <[EMAIL PROTECTED]> writes: > | > { > | > + struct stat st; > | > fp = AllocateFile(filename, PG_BINARY_R); > > | > + fclose(fp); > | > | This coding is WRONG. You

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

2002-02-23 Thread Brent Verner
[2002-02-23 20:27] Tom Lane said: | Bruce Momjian <[EMAIL PROTECTED]> writes: | > { | > + struct stat st; | > fp = AllocateFile(filename, PG_BINARY_R); | > + fclose(fp); | | This coding is WRONG. You do not use fclose() to release a file | opened wi

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

2002-02-23 Thread Brent Verner
[2002-02-23 20:27] Tom Lane said: | Bruce Momjian <[EMAIL PROTECTED]> writes: | > { | > + struct stat st; | > fp = AllocateFile(filename, PG_BINARY_R); | > + fclose(fp); | | This coding is WRONG. You do not use fclose() to release a file | opened wi

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

2002-02-23 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > { > + struct stat st; > fp = AllocateFile(filename, PG_BINARY_R); > ! > ! if (fp == NULL) > elog(ERROR, "COPY command, running in backend with " >

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

2002-02-23 Thread Bruce Momjian
OK'ed by Peter. Patch applied. Thanks. --- Brent Verner wrote: > [2002-01-17 07:08] Brent Verner said: > | [2002-01-16 17:47] Douglas Trainor said: > | | I'd like to report a bug in 7.1.3 psql (at least on a 64-bit Alpha