postgresql/contrib/pageinspect
Tom Lane 9dc2a3fd0a Check block number against the correct fork in get_raw_page().
get_raw_page tried to validate the supplied block number against
RelationGetNumberOfBlocks(), which of course is only right when
accessing the main fork.  In most cases, the main fork is longer
than the others, so that the check was too weak (allowing a
lower-level error to be reported, but no real harm to be done).
However, very small tables could have an FSM larger than their heap,
in which case the mistake prevented access to some FSM pages.
Per report from Torsten Foertsch.

In passing, make the bad-block-number error into an ereport not elog
(since it's certainly not an internal error); and fix sloppily
maintained comment for RelationGetNumberOfBlocksInFork.

This has been wrong since we invented relation forks, so back-patch
to all supported branches.
2014-07-22 11:46:04 -04:00
..
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
btreefuncs.c Take buffer lock while inspecting btree index pages in contrib/pageinspect. 2012-11-30 17:02:44 -05:00
fsmfuncs.c Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
heapfuncs.c Fix minor typos in comments. 2010-04-02 15:19:22 +00:00
Makefile Rewrite the FSM. Instead of relying on a fixed-size shared memory segment, the 2008-09-30 10:52:14 +00:00
pageinspect.sql.in Fix contrib/pageinspect to not create an ABI breakage between 8.3 and 8.4. 2009-06-08 16:22:44 +00:00
rawpage.c Check block number against the correct fork in get_raw_page(). 2014-07-22 11:46:04 -04:00
uninstall_pageinspect.sql Fix contrib/pageinspect to not create an ABI breakage between 8.3 and 8.4. 2009-06-08 16:22:44 +00:00