summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier2022-04-02 02:27:20 +0000
committerMichael Paquier2022-04-02 02:27:20 +0000
commitd43085d12e825ede628bafee1e5e6e0e3a3d5e67 (patch)
tree54eb4704908b59573aa20f58540a376ac77766c8
parent465ab24296c27502c81c8c197725cba728b9b057 (diff)
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.
-rw-r--r--contrib/pageinspect/ginfuncs.c6
-rw-r--r--contrib/pageinspect/gistfuncs.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/contrib/pageinspect/ginfuncs.c b/contrib/pageinspect/ginfuncs.c
index 7ad6d2d3bdd..1c56fa18cdc 100644
--- a/contrib/pageinspect/ginfuncs.c
+++ b/contrib/pageinspect/ginfuncs.c
@@ -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),
diff --git a/contrib/pageinspect/gistfuncs.c b/contrib/pageinspect/gistfuncs.c
index 6bb81ffb840..b2bbf4f6cbc 100644
--- a/contrib/pageinspect/gistfuncs.c
+++ b/contrib/pageinspect/gistfuncs.c
@@ -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),