Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d22b85f

Browse files
committed
Remove unused macros.
CHECK_PAGE_OFFSET_RANGE() has been unused forever. CHECK_RELATION_BLOCK_RANGE() has been unused in pgstatindex.c ever since bt_page_stats() and bt_page_items() functions were moved from pgstattuple to pageinspect module. It still exists in pageinspect/btreefuncs.c. Daniel Gustafsson
1 parent a956bf4 commit d22b85f

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

contrib/pageinspect/btreefuncs.c

-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ PG_FUNCTION_INFO_V1(bt_page_stats);
4343
#define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX)
4444
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
4545

46-
#define CHECK_PAGE_OFFSET_RANGE(pg, offnum) { \
47-
if ( !(FirstOffsetNumber <= (offnum) && \
48-
(offnum) <= PageGetMaxOffsetNumber(pg)) ) \
49-
elog(ERROR, "page offset number out of range"); }
50-
5146
/* note: BlockNumber is unsigned, hence can't be negative */
5247
#define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \
5348
if ( RelationGetNumberOfBlocks(rel) <= (BlockNumber) (blkno) ) \

contrib/pgstattuple/pgstatindex.c

-10
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,6 @@ PG_FUNCTION_INFO_V1(pgstatginindex);
5858
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
5959
#define IS_GIN(r) ((r)->rd_rel->relam == GIN_AM_OID)
6060

61-
#define CHECK_PAGE_OFFSET_RANGE(pg, offnum) { \
62-
if ( !(FirstOffsetNumber <= (offnum) && \
63-
(offnum) <= PageGetMaxOffsetNumber(pg)) ) \
64-
elog(ERROR, "page offset number out of range"); }
65-
66-
/* note: BlockNumber is unsigned, hence can't be negative */
67-
#define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \
68-
if ( RelationGetNumberOfBlocks(rel) <= (BlockNumber) (blkno) ) \
69-
elog(ERROR, "block number out of range"); }
70-
7161
/* ------------------------------------------------
7262
* A structure for a whole btree index statistics
7363
* used by pgstatindex().

0 commit comments

Comments
 (0)