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:
@ -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;
|
||||
|
Reference in New Issue
Block a user