Re: BUG #7624: Misleading Log Message & Inconsistent Configuration Design

From: Tianyin Xu <tixu(at)cs(dot)ucsd(dot)edu>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7624: Misleading Log Message & Inconsistent Configuration Design
Date: 2012-10-30 05:38:46
Message-ID: CABBDWwdOEzc8dj6fNm-Pj2-vt=oHV+tFqsf=cC7askRc=jDHkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi, Craig,

Thanks a lot for your response. Sorry to make the bug report so long... I
was a little pissed off by myself for my stupidness after spending around 2
hours on this issue.

Yes, your message is definitely better and explicit by pointing out CWD.

The only concern to me is whether or not CWD is a common abbreviation,
especially for non-native speakers. Searching "CWD" on google, I didn't
find it refers to Current Working Directory in the first 3 returned pages.

To me, printing an explicit log message is the easiest way to solve the
problem. But the configuration file design is still not consistent (maybe
I'm too picky). In the following settings, we have to tell users that the
first 3 works and the last 1 does not work because of chdir blah blah blah.

data_directory = 'local/pgsql/data/'
hba_file = 'local/pgsql/data/pg_hba.conf'
ident_file = 'local/pgsql/data/pg_ident.conf'
unix_socket_directory = 'local/pgsql/data/'

Thanks,
Tianyin

On Mon, Oct 29, 2012 at 7:46 PM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> wrote:

> On 10/28/2012 03:35 PM, tixu(at)cs(dot)ucsd(dot)edu wrote:
> > I really suggest to make the configuration file consistent in this case.
> But
> > I understand it might not be easy. But at least I think we should print a
> > better log message which pinpoints to the absolute path like
> >
> > FATAL: 58P01: could not create lock file
> >
> "/home/tianyin/postgresql-9.2.1/local/pgsql/data/local/pgsql/data/.s.PGSQL.5432.lock":
> > No such file or directory
>
> Essentially, you want PostgreSQL to print absolute paths in error
> messages, instead of paths relative to the server datadir?
>
> I'd prefer to do it slightly differently, but I like the general idea.
> I'd instead want to write:
>
> FATAL: 58P01: could not create lock file
> "local/pgsql/data/.s.PGSQL.5432.lock"
> (cwd="/home/tianyin/postgresql-9.2.1/local/pgsql/data/"): No such file
> or directory
>
> By spelling out the CWD explicitly there's no impression given that the
> user ever actually specified the whole path in the configuration
> anywhere, so it's clearer how the path came to be. It also shows which
> part of the path is known-good (since it's the CWD) and which could be
> at issue.
>
> --
> Craig Ringer
>

--
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Simon Riggs 2012-10-30 09:23:17 Re: BUG #7627: Bad query plan when using LIMIT
Previous Message Tom Lane 2012-10-30 05:27:12 Re: BUG #7627: Bad query plan when using LIMIT