pgsql: Improve error reporting when location specified by postgres -D d

Started by Peter Eisentrautover 10 years ago3 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Improve error reporting when location specified by postgres -D does not exist

Previously, the first error seen would be that postgresql.conf does not
exist. But for the case where the whole directory does not exist, give
an error message about that, together with a hint for how to create one.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/ac7238dc0faccb0ad077aa9922df6e75b0b1bda3

Modified Files
--------------
src/backend/utils/misc/guc.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: pgsql: Improve error reporting when location specified by postgres -D d

Peter Eisentraut <peter_e@gmx.net> writes:

+   if (configdir && stat(configdir, &stat_buf) != 0)
+   {
+       write_stderr("%s: could not access \"%s\": %s\n",
+                    progname,
+                    configdir,
+                    strerror(errno));

Perhaps "could not access directory ..."? This doesn't seem to follow the
message style guideline about specifying what sort of object you're
complaining about.

regards, tom lane

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: pgsql: Improve error reporting when location specified by postgres -D d

On 2/2/16 11:26 PM, Tom Lane wrote:

Peter Eisentraut <peter_e@gmx.net> writes:

+   if (configdir && stat(configdir, &stat_buf) != 0)
+   {
+       write_stderr("%s: could not access \"%s\": %s\n",
+                    progname,
+                    configdir,
+                    strerror(errno));

Perhaps "could not access directory ..."? This doesn't seem to follow the
message style guideline about specifying what sort of object you're
complaining about.

Done.

Somehow I was under the mistaken impression that one could also specific
a config file name there.

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers