summaryrefslogtreecommitdiff
path: root/contrib/pageinspect/btreefuncs.c
diff options
context:
space:
mode:
authorKevin Grittner2016-04-20 13:31:19 +0000
committerKevin Grittner2016-04-20 13:31:19 +0000
commita343e223a5c33a7283a6d8b255c9dbc48dbc5061 (patch)
treef02f3de305180170d8d5e51120861ae6770b31e8 /contrib/pageinspect/btreefuncs.c
parent4db0d2d2fe935e086dfd26c00f707dab298b443c (diff)
Revert no-op changes to BufferGetPage()
The reverted changes were intended to force a choice of whether any newly-added BufferGetPage() calls needed to be accompanied by a test of the snapshot age, to support the "snapshot too old" feature. Such an accompanying test is needed in about 7% of the cases, where the page is being used as part of a scan rather than positioning for other purposes (such as DML or vacuuming). The additional effort required for back-patching, and the doubt whether the intended benefit would really be there, have indicated it is best just to rely on developers to do the right thing based on comments and existing usage, as we do with many other conventions. This change should have little or no effect on generated executable code. Motivated by the back-patching pain of Tom Lane and Robert Haas
Diffstat (limited to 'contrib/pageinspect/btreefuncs.c')
-rw-r--r--contrib/pageinspect/btreefuncs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c
index cdeffe3e013..d088ce57197 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, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ Page page = BufferGetPage(buffer);
PageHeader phdr = (PageHeader) page;
OffsetNumber maxoff = PageGetMaxOffsetNumber(page);
BTPageOpaque opaque = (BTPageOpaque) PageGetSpecialPointer(page);
@@ -317,9 +317,7 @@ bt_page_items(PG_FUNCTION_ARGS)
uargs = palloc(sizeof(struct user_args));
uargs->page = palloc(BLCKSZ);
- memcpy(uargs->page,
- BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST),
- BLCKSZ);
+ memcpy(uargs->page, BufferGetPage(buffer), BLCKSZ);
UnlockReleaseBuffer(buffer);
relation_close(rel, AccessShareLock);
@@ -449,7 +447,7 @@ bt_metap(PG_FUNCTION_ARGS)
buffer = ReadBuffer(rel, 0);
LockBuffer(buffer, BUFFER_LOCK_SHARE);
- page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
+ page = BufferGetPage(buffer);
metad = BTPageGetMeta(page);
/* Build a tuple descriptor for our result type */