diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-31 15:05:00 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-31 15:05:00 +0000 |
commit | 19c8dc839b64a43958f08108b85ce8ca98d06a8b (patch) | |
tree | be6bff739a33bd11e4915f47f30038840d397cd5 /contrib/pageinspect/rawpage.c | |
parent | 29077051deae30b7704a3e3f2cf7d0a7e3a4130a (diff) | |
download | postgresql-19c8dc839b64a43958f08108b85ce8ca98d06a8b.tar.gz postgresql-19c8dc839b64a43958f08108b85ce8ca98d06a8b.zip |
Unite ReadBufferWithFork, ReadBufferWithStrategy, and ZeroOrReadBuffer
functions into one ReadBufferExtended function, that takes the strategy
and mode as argument. There's three modes, RBM_NORMAL which is the default
used by plain ReadBuffer(), RBM_ZERO, which replaces ZeroOrReadBuffer, and
a new mode RBM_ZERO_ON_ERROR, which allows callers to read corrupt pages
without throwing an error. The FSM needs the new mode to recover from
corrupt pages, which could happend if we crash after extending an FSM file,
and the new page is "torn".
Add fork number to some error messages in bufmgr.c, that still lacked it.
Diffstat (limited to 'contrib/pageinspect/rawpage.c')
-rw-r--r-- | contrib/pageinspect/rawpage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c index 13216d12e04..d301fd7ad17 100644 --- a/contrib/pageinspect/rawpage.c +++ b/contrib/pageinspect/rawpage.c @@ -8,7 +8,7 @@ * Copyright (c) 2007-2008, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.8 2008/10/06 14:13:17 heikki Exp $ + * $PostgreSQL: pgsql/contrib/pageinspect/rawpage.c,v 1.9 2008/10/31 15:04:59 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -85,7 +85,7 @@ get_raw_page(PG_FUNCTION_ARGS) /* Take a verbatim copy of the page */ - buf = ReadBufferWithFork(rel, forknum, blkno); + buf = ReadBufferExtended(rel, forknum, blkno, RBM_NORMAL, NULL); LockBuffer(buf, BUFFER_LOCK_SHARE); memcpy(raw_page_data, BufferGetPage(buf), BLCKSZ); |