pgsql: Improve error messages in md.c. - Mailing list pgsql-committers

From heikki@postgresql.org (Heikki Linnakangas)
Subject pgsql: Improve error messages in md.c.
Date
Msg-id 20090805180154.F264D75331E@cvs.postgresql.org
Whole thread Raw
Responses Re: pgsql: Improve error messages in md.c.
List 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)

pgsql-committers by date:

Previous
From: joe@postgresql.org (Joe Conway)
Date:
Subject: pgsql: Implement dblink_get_notify().
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Add matchorig, matchsynonyms, and keepsynonyms options to