Re: [GENERAL] WARNING: could not remove database directory - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] WARNING: could not remove database directory
Date
Msg-id 12436.1108146981@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] WARNING: could not remove database directory  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [GENERAL] WARNING: could not remove database directory
Re: [GENERAL] WARNING: could not remove database directory
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom Lane wrote:
>> [ looks at code... ]  dbcommands.c is expecting that rmtree() will have
>> printed out a more-detailed message about the problem, but someone has
>> carefully removed every trace of error reporting from rmtree().

> I think the issue is that we didn't want different object files for
> client and server output message and and returning error codes and
> having every calling location print strings was unmaintainable.

But we already bit that bullet.  Look at the other routines in dirmod.c:

#ifndef FRONTEND       ereport(ERROR,               (errcode_for_file_access(),                errmsg("Error setting
junctionfor %s: %s",                       nativeTarget, msg)));
 
#else       fprintf(stderr, "Error setting junction for %s: %s\n",               nativeTarget, msg);
#endif

It's certainly not realistic to pass back enough information from
rmtree() to let the caller print a useful error message, so I think
we have to add reporting code along this line to rmtree().
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] WARNING: could not remove database directory
Next
From: Bruce Momjian
Date:
Subject: Re: [GENERAL] WARNING: could not remove database directory