Re: pgsql: Improve error handling in RemovePgTempFiles().

2018-01-07 Thread Tom Lane
Thomas Munro writes: > Perhaps RemovePgTempFiles() could check if each one exists before > calling RemovePgTempFilesInDir(), like in the attached? Alternatively > we could make RemovePgTempFilesInDir() return early if temp_dir == > NULL (going against your commit message above), or I suppose we c

pgsql: Back off chattiness in RemovePgTempFiles().

2018-01-07 Thread Tom Lane
Back off chattiness in RemovePgTempFiles(). In commit 561885db0, as part of normalizing RemovePgTempFiles's error handling, I removed its behavior of silently ignoring ENOENT failures during directory opens. Thomas Munro points out that this is a bad idea at the top level, because we don't create

Re: pgsql: Improve error handling in RemovePgTempFiles().

2018-01-07 Thread Tom Lane
I wrote: > Hmmm ... actually, in the recursive call case, it wouldn't be that > awful to ignore ENOENT either; if a directory goes away between being > stat'd and being opened, you'd still get a log message about rmdir > failure at the caller level. So maybe we should just do your > second alterna

Re: pgsql: Improve error handling in RemovePgTempFiles().

2018-01-07 Thread Thomas Munro
On Mon, Jan 8, 2018 at 2:41 PM, Tom Lane wrote: > I wrote: >> Hmmm ... actually, in the recursive call case, it wouldn't be that >> awful to ignore ENOENT either; if a directory goes away between being >> stat'd and being opened, you'd still get a log message about rmdir >> failure at the caller l

Re: pgsql: Improve error handling in RemovePgTempFiles().

2018-01-07 Thread Tom Lane
Thomas Munro writes: > On Mon, Jan 8, 2018 at 2:41 PM, Tom Lane wrote: >> Hearing no comments, I did it the first way. > It's funny that the two boolean arguments are always opposite. > They're essentially both saying "top level?". Yeah. I thought about using a single "bool top_level" argument