mirror of
https://github.com/postgres/postgres.git
synced 2026-04-21 22:28:15 -04:00
pageinspect: Use better macros to get special page area for GIN and GiST
These five code paths are the last ones that made use of
PageGetSpecialPointer() to get the special area of such pages, while
those index AMs have already macros to do this job.
Noticed while reviewing the use PageGetSpecialPointer() in the whole
tree, in relation to the recent commit d16773c.
This commit is contained in:
parent
465ab24296
commit
d43085d12e
2 changed files with 5 additions and 5 deletions
|
|
@ -57,7 +57,7 @@ gin_metapage_info(PG_FUNCTION_ARGS)
|
|||
(int) MAXALIGN(sizeof(GinPageOpaqueData)),
|
||||
(int) PageGetSpecialSize(page))));
|
||||
|
||||
opaq = (GinPageOpaque) PageGetSpecialPointer(page);
|
||||
opaq = GinPageGetOpaque(page);
|
||||
if (opaq->flags != GIN_META)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
|
|
@ -123,7 +123,7 @@ gin_page_opaque_info(PG_FUNCTION_ARGS)
|
|||
(int) MAXALIGN(sizeof(GinPageOpaqueData)),
|
||||
(int) PageGetSpecialSize(page))));
|
||||
|
||||
opaq = (GinPageOpaque) PageGetSpecialPointer(page);
|
||||
opaq = GinPageGetOpaque(page);
|
||||
|
||||
/* Build a tuple descriptor for our result type */
|
||||
if (get_call_result_type(fcinfo, NULL, &tupdesc) != TYPEFUNC_COMPOSITE)
|
||||
|
|
@ -208,7 +208,7 @@ gin_leafpage_items(PG_FUNCTION_ARGS)
|
|||
(int) MAXALIGN(sizeof(GinPageOpaqueData)),
|
||||
(int) PageGetSpecialSize(page))));
|
||||
|
||||
opaq = (GinPageOpaque) PageGetSpecialPointer(page);
|
||||
opaq = GinPageGetOpaque(page);
|
||||
if (opaq->flags != (GIN_DATA | GIN_LEAF | GIN_COMPRESSED))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ gist_page_opaque_info(PG_FUNCTION_ARGS)
|
|||
(int) MAXALIGN(sizeof(GISTPageOpaqueData)),
|
||||
(int) PageGetSpecialSize(page))));
|
||||
|
||||
opaq = (GISTPageOpaque) PageGetSpecialPointer(page);
|
||||
opaq = GistPageGetOpaque(page);
|
||||
if (opaq->gist_page_id != GIST_PAGE_ID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
|
|
@ -139,7 +139,7 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
|
|||
(int) MAXALIGN(sizeof(GISTPageOpaqueData)),
|
||||
(int) PageGetSpecialSize(page))));
|
||||
|
||||
opaq = (GISTPageOpaque) PageGetSpecialPointer(page);
|
||||
opaq = GistPageGetOpaque(page);
|
||||
if (opaq->gist_page_id != GIST_PAGE_ID)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
|
|
|
|||
Loading…
Reference in a new issue