Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd43085d

Browse files
committed
pageinspect: Use better macros to get special page area for GIN and GiST
These five code paths are the last ones that made use ofPageGetSpecialPointer() to get the special area of such pages, whilethose index AMs have already macros to do this job.Noticed while reviewing the use PageGetSpecialPointer() in the wholetree, in relation to the recent commitd16773c.
1 parent465ab24 commitd43085d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎contrib/pageinspect/ginfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ gin_metapage_info(PG_FUNCTION_ARGS)
5757
(int)MAXALIGN(sizeof(GinPageOpaqueData)),
5858
(int)PageGetSpecialSize(page))));
5959

60-
opaq=(GinPageOpaque)PageGetSpecialPointer(page);
60+
opaq=GinPageGetOpaque(page);
6161
if (opaq->flags!=GIN_META)
6262
ereport(ERROR,
6363
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@@ -123,7 +123,7 @@ gin_page_opaque_info(PG_FUNCTION_ARGS)
123123
(int)MAXALIGN(sizeof(GinPageOpaqueData)),
124124
(int)PageGetSpecialSize(page))));
125125

126-
opaq=(GinPageOpaque)PageGetSpecialPointer(page);
126+
opaq=GinPageGetOpaque(page);
127127

128128
/* Build a tuple descriptor for our result type */
129129
if (get_call_result_type(fcinfo,NULL,&tupdesc)!=TYPEFUNC_COMPOSITE)
@@ -208,7 +208,7 @@ gin_leafpage_items(PG_FUNCTION_ARGS)
208208
(int)MAXALIGN(sizeof(GinPageOpaqueData)),
209209
(int)PageGetSpecialSize(page))));
210210

211-
opaq=(GinPageOpaque)PageGetSpecialPointer(page);
211+
opaq=GinPageGetOpaque(page);
212212
if (opaq->flags!= (GIN_DATA |GIN_LEAF |GIN_COMPRESSED))
213213
ereport(ERROR,
214214
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

‎contrib/pageinspect/gistfuncs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ gist_page_opaque_info(PG_FUNCTION_ARGS)
6464
(int)MAXALIGN(sizeof(GISTPageOpaqueData)),
6565
(int)PageGetSpecialSize(page))));
6666

67-
opaq=(GISTPageOpaque)PageGetSpecialPointer(page);
67+
opaq=GistPageGetOpaque(page);
6868
if (opaq->gist_page_id!=GIST_PAGE_ID)
6969
ereport(ERROR,
7070
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
@@ -139,7 +139,7 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
139139
(int)MAXALIGN(sizeof(GISTPageOpaqueData)),
140140
(int)PageGetSpecialSize(page))));
141141

142-
opaq=(GISTPageOpaque)PageGetSpecialPointer(page);
142+
opaq=GistPageGetOpaque(page);
143143
if (opaq->gist_page_id!=GIST_PAGE_ID)
144144
ereport(ERROR,
145145
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp