pgsql: Improve error messages in md.c.

From: heikki(at)postgresql(dot)org (Heikki Linnakangas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve error messages in md.c.
Date: 2009-08-05 18:01:54
Message-ID: 20090805180154.F264D75331E@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Improve error messages in md.c. When a filesystem operation like open() or
fsync() fails, say "file" rather than "relation" when printing the filename.

This makes messages that display block numbers a bit confusing. For example,
in message 'could not read block 150000 of file "base/1234/5678.1"', 150000
is the block number from the beginning of the relation, ie. segment 0, not
150000th block within that segment. Per discussion, users aren't usually
interested in the exact location within the file, so we can live with that.

To ease constructing error messages, add FilePathName(File) function to
return the pathname of a virtual fd.

Modified Files:
--------------
pgsql/src/backend/storage/file:
fd.c (r1.149 -> r1.150)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/file/fd.c?r1=1.149&r2=1.150)
pgsql/src/backend/storage/smgr:
md.c (r1.148 -> r1.149)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/smgr/md.c?r1=1.148&r2=1.149)
pgsql/src/include/storage:
fd.h (r1.64 -> r1.65)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/fd.h?r1=1.64&r2=1.65)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-08-05 18:02:27 Re: [COMMITTERS] pgsql: Use DocBook XSL stylesheets for man page building This switches
Previous Message Joe Conway 2009-08-05 16:11:07 pgsql: Implement dblink_get_notify().