]> granicus.if.org Git - postgresql/commit
Improve error messages in md.c. When a filesystem operation like open() or
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 5 Aug 2009 18:01:54 +0000 (18:01 +0000)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Wed, 5 Aug 2009 18:01:54 +0000 (18:01 +0000)
commit23dc89d2c385e8e362cb4b8186b4d4ad02242ac0
tree670020a84a87526aaa6f0f9421c125da8194ef50
parentf4095b4c4b24a6fd2c1c330e572c24c6a9c99ea9
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.
src/backend/storage/file/fd.c
src/backend/storage/smgr/md.c
src/include/storage/fd.h