summaryrefslogtreecommitdiff
path: root/contrib/pageinspect/hashfuncs.c
diff options
context:
space:
mode:
authorMichael Paquier2022-04-01 04:24:50 +0000
committerMichael Paquier2022-04-01 04:24:50 +0000
commitd16773cdc86210493a2874cb0cf93f3883fcda73 (patch)
tree24306ded63bd036dc2eb37be6f817048c986eccd /contrib/pageinspect/hashfuncs.c
parent73db8f4d17ed4efb7709f1cafd5b1dd0285b0842 (diff)
Add macros in hash and btree AMs to get the special area of their pages
This makes the code more consistent with SpGiST, GiST and GIN, that already use this style, and the idea is to make easier the introduction of more sanity checks for each of these AM-specific macros. BRIN uses a different set of macros to get a page's type and flags, so it has no need for something similar. Author: Matthias van de Meent Discussion: https://postgr.es/m/CAEze2WjE3+tGO9Fs9+iZMU+z6mMZKo54W1Zt98WKqbEUHbHOBg@mail.gmail.com
Diffstat (limited to 'contrib/pageinspect/hashfuncs.c')
-rw-r--r--contrib/pageinspect/hashfuncs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c
index 6de21d66089..69af7b962ff 100644
--- a/contrib/pageinspect/hashfuncs.c
+++ b/contrib/pageinspect/hashfuncs.c
@@ -72,7 +72,7 @@ verify_hash_page(bytea *raw_page, int flags)
(int) MAXALIGN(sizeof(HashPageOpaqueData)),
(int) PageGetSpecialSize(page))));
- pageopaque = (HashPageOpaque) PageGetSpecialPointer(page);
+ pageopaque = HashPageGetOpaque(page);
if (pageopaque->hasho_page_id != HASHO_PAGE_ID)
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@@ -154,7 +154,7 @@ static void
GetHashPageStatistics(Page page, HashPageStat *stat)
{
OffsetNumber maxoff = PageGetMaxOffsetNumber(page);
- HashPageOpaque opaque = (HashPageOpaque) PageGetSpecialPointer(page);
+ HashPageOpaque opaque = HashPageGetOpaque(page);
int off;
stat->dead_items = stat->live_items = 0;
@@ -206,7 +206,7 @@ hash_page_type(PG_FUNCTION_ARGS)
type = "unused";
else
{
- opaque = (HashPageOpaque) PageGetSpecialPointer(page);
+ opaque = HashPageGetOpaque(page);
/* page type (flags) */
pagetype = opaque->hasho_flag & LH_PAGE_TYPE;