summaryrefslogtreecommitdiff
path: root/contrib/pageinspect
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-04-08 14:30:10 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-04-08 14:30:10 -0500
commit8b65cf4c5edabdcae45ceaef7b9ac236879aae50 (patch)
treef4412d3e9bc0db823ac32e08fac8e3124b42ff02 /contrib/pageinspect
parent689f9a058854a1a32e994818dd6d79f49d8f8a1b (diff)
downloadpostgresql-8b65cf4c5edabdcae45ceaef7b9ac236879aae50.tar.gz
Modify BufferGetPage() to prepare for "snapshot too old" feature
This patch is a no-op patch which is intended to reduce the chances of failures of omission once the functional part of the "snapshot too old" patch goes in. It adds parameters for snapshot, relation, and an enum to specify whether the snapshot age check needs to be done for the page at this point. This initial patch passes NULL for the first two new parameters and BGP_NO_SNAPSHOT_TEST for the third. The follow-on patch will change the places where the test needs to be made.
Diffstat (limited to 'contrib/pageinspect')
-rw-r--r--contrib/pageinspect/btreefuncs.c8
-rw-r--r--contrib/pageinspect/rawpage.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c
index d088ce5719..cdeffe3e01 100644
--- a/contrib/pageinspect/btreefuncs.c
+++ b/contrib/pageinspect/btreefuncs.c
@@ -90,7 +90,7 @@ typedef struct BTPageStat
static void
GetBTPageStatistics(BlockNumber blkno, Buffer buffer, BTPageStat *stat)
{
- Page page = BufferGetPage(buffer);
+ Page page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
PageHeader phdr = (PageHeader) page;
OffsetNumber maxoff = PageGetMaxOffsetNumber(page);
BTPageOpaque opaque = (BTPageOpaque) PageGetSpecialPointer(page);
@@ -317,7 +317,9 @@ bt_page_items(PG_FUNCTION_ARGS)
uargs = palloc(sizeof(struct user_args));
uargs->page = palloc(BLCKSZ);
- memcpy(uargs->page, BufferGetPage(buffer), BLCKSZ);
+ memcpy(uargs->page,
+ BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST),
+ BLCKSZ);
UnlockReleaseBuffer(buffer);
relation_close(rel, AccessShareLock);
@@ -447,7 +449,7 @@ bt_metap(PG_FUNCTION_ARGS)
buffer = ReadBuffer(rel, 0);
LockBuffer(buffer, BUFFER_LOCK_SHARE);
- page = BufferGetPage(buffer);
+ page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
metad = BTPageGetMeta(page);
/* Build a tuple descriptor for our result type */
diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c
index 71d0c8d2ca..139419ae1a 100644
--- a/contrib/pageinspect/rawpage.c
+++ b/contrib/pageinspect/rawpage.c
@@ -147,7 +147,9 @@ get_raw_page_internal(text *relname, ForkNumber forknum, BlockNumber blkno)
buf = ReadBufferExtended(rel, forknum, blkno, RBM_NORMAL, NULL);
LockBuffer(buf, BUFFER_LOCK_SHARE);
- memcpy(raw_page_data, BufferGetPage(buf), BLCKSZ);
+ memcpy(raw_page_data,
+ BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST),
+ BLCKSZ);
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
ReleaseBuffer(buf);