postgresql/src
Tom Lane c6c67505e4 Fix error handling in temp-file deletion with log_temp_files active.
The original coding in FileClose() reset the file-is-temp flag before
unlinking the file, so that if control came back through due to an error,
it wouldn't try to unlink the file twice.  This was correct when written,
but when the log_temp_files feature was added, the logging action was put
in between those two steps.  An error occurring during the logging action
--- such as a query cancel --- would result in the unlink not getting done
at all, as in recent report from Michael Glaesemann.

To fix this, make sure that we do both the stat and the unlink before doing
anything that could conceivably CHECK_FOR_INTERRUPTS.  There is a judgment
call here, which is which log message to emit first: if you can see only
one, which should it be?  I chose to log unlink failure at the risk of
losing the log_temp_files log message --- after all, if the unlink does
fail, the temp file is still there for you to see.

Back-patch to all versions that have log_temp_files.  The code was OK
before that.
2010-11-08 22:14:55 -05:00
..
backend Fix error handling in temp-file deletion with log_temp_files active. 2010-11-08 22:14:55 -05:00
bin Fix up some oversights in psql's Unicode-escape support. 2010-10-26 22:25:42 -04:00
include Make OFF keyword unreserved. It's not hard to imagine wanting to use 'off' 2010-10-22 17:44:36 +03:00
interfaces Fix ecpg test building process to not generate *.dSYM junk on Macs. 2010-10-20 00:55:03 -04:00
makefiles Allow for LDFLAGS_SL already having a value in Makefile.aix. 2010-07-06 03:41:02 +00:00
pl Fix plpgsql's handling of "simple" expression evaluation. 2010-10-28 13:02:33 -04:00
port Tag 9.0.1 2010-10-01 10:28:42 -03:00
template Don't try to force use of -no-cpp-precomp on OS X. It's been five years 2010-08-02 04:51:25 +00:00
test Reduce recursion depth in recently-added regression test. 2010-11-03 13:41:53 -04:00
timezone Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
tools Fix msvc build for localized versions of Visual C++ 2010-10-17 16:38:54 +02:00
tutorial Remove copyright mention of Andrew Yu, per author's permission. 2010-02-02 18:52:02 +00:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Rethink the way walreceiver is linked into the backend. Instead than shoving 2010-01-20 09:16:24 +00:00
Makefile.global.in Accept slightly grotty coding in Makefile.global in order to keep the -L 2010-07-06 22:03:05 +00:00
Makefile.shlib Still more third thoughts: when linking shared libraries, LDFLAGS probably 2010-07-06 03:55:33 +00:00
nls-global.mk Avoid error from mkdir if no languages are to be installed 2010-05-13 14:35:28 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00