postgresql/src/backend
Tom Lane 561885db05 Improve error handling in RemovePgTempFiles().
Modify this function and its subsidiaries so that syscall failures are
reported via ereport(LOG), rather than silently ignored as before.
We don't want to throw a hard ERROR, as that would prevent database
startup, and getting rid of leftover temporary files is not important
enough for that.  On the other hand, not reporting trouble at all
seems like an odd choice not in line with current project norms,
especially since any failure here is quite unexpected.

On the same reasoning, adjust these functions' AllocateDir/ReadDir calls
so that failure to scan a directory results in LOG not ERROR.  I also
removed the previous practice of silently ignoring ENOENT failures during
directory opens --- there are some corner cases where that could happen
given a previous database crash, but that seems like a bad excuse for
ignoring a condition that isn't expected in most cases.  A LOG message
during postmaster start seems OK in such situations, and better than
no output at all.

In passing, make RemovePgTempRelationFiles' test for "is the file name
all digits" look more like the way it's done elsewhere.

Discussion: https://postgr.es/m/19907.1512402254@sss.pgh.pa.us
2017-12-04 17:59:35 -05:00
..
access Clean up assorted messiness around AllocateDir() usage. 2017-12-04 17:02:56 -05:00
bootstrap Exclude flex-generated code from coverage testing 2017-10-16 16:28:11 -04:00
catalog Minor code beautification in partition_bounds_equal. 2017-12-01 13:52:59 -05:00
commands When VACUUM or ANALYZE skips a concurrently dropped table, log it. 2017-12-04 15:25:55 -05:00
executor Remove memory leak protection from Gather and Gather Merge nodes. 2017-12-04 10:39:24 -05:00
foreign Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
lib Allow to avoid NUL-byte management for stringinfos and use in format.c. 2017-10-11 16:01:52 -07:00
libpq Check channel binding flag at end of SCRAM exchange 2017-12-01 09:53:26 -05:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:00 -08:00
nodes Remove extra word from comment. 2017-11-30 16:22:38 -05:00
optimizer Try to exclude partitioned tables in toto. 2017-12-01 10:59:09 -05:00
parser Re-allow INSERT .. ON CONFLICT DO NOTHING on partitioned tables. 2017-12-01 12:53:21 -05:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
postmaster Clean up assorted messiness around AllocateDir() usage. 2017-12-04 17:02:56 -05:00
regex Mop-up for commit 85feb77aa0. 2017-09-22 11:35:12 -04:00
replication Clean up assorted messiness around AllocateDir() usage. 2017-12-04 17:02:56 -05:00
rewrite Fix creation of resjunk tlist entries for inherited mixed UPDATE/DELETE. 2017-11-27 17:54:07 -05:00
snowball Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
statistics Support boolean columns in functional-dependency statistics. 2017-12-04 11:51:43 -05:00
storage Improve error handling in RemovePgTempFiles(). 2017-12-04 17:59:35 -05:00
tcop SQL procedures 2017-11-30 11:03:20 -05:00
tsearch Update typedefs.list and re-run pgindent 2017-11-29 09:24:24 -05:00
utils Clean up assorted messiness around AllocateDir() usage. 2017-12-04 17:02:56 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
Makefile Inject $(ICU_LIBS) regardless of platform. 2017-08-20 21:22:18 -07:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00