1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Michael Paquier
2022-04-01 13:24:50 +09:00
parent 73db8f4d17
commit d16773cdc8
23 changed files with 186 additions and 182 deletions

View File

@ -281,7 +281,7 @@ pgstatindex_impl(Relation rel, FunctionCallInfo fcinfo)
LockBuffer(buffer, BUFFER_LOCK_SHARE);
page = BufferGetPage(buffer);
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
opaque = BTPageGetOpaque(page);
/*
* Determine page type, and update totals.
@ -641,7 +641,7 @@ pgstathashindex(PG_FUNCTION_ARGS)
HashPageOpaque opaque;
int pagetype;
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
opaque = HashPageGetOpaque(page);
pagetype = opaque->hasho_flag & LH_PAGE_TYPE;
if (pagetype == LH_BUCKET_PAGE)