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:
@ -415,7 +415,7 @@ pgstat_btree_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno,
|
||||
{
|
||||
BTPageOpaque opaque;
|
||||
|
||||
opaque = (BTPageOpaque) PageGetSpecialPointer(page);
|
||||
opaque = BTPageGetOpaque(page);
|
||||
if (P_IGNORE(opaque))
|
||||
{
|
||||
/* deleted or half-dead page */
|
||||
@ -452,7 +452,7 @@ pgstat_hash_page(pgstattuple_type *stat, Relation rel, BlockNumber blkno,
|
||||
{
|
||||
HashPageOpaque opaque;
|
||||
|
||||
opaque = (HashPageOpaque) PageGetSpecialPointer(page);
|
||||
opaque = HashPageGetOpaque(page);
|
||||
switch (opaque->hasho_flag & LH_PAGE_TYPE)
|
||||
{
|
||||
case LH_UNUSED_PAGE:
|
||||
|
Reference in New Issue
Block a user