10000 Remove unused macros. · prmdeveloper/postgres@a840c14 · GitHub
[go: up one dir, main page]

Skip to content

Commit a840c14

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 72edc8f commit a840c14

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

contrib/pageinspect/btreefuncs.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ PG_FUNCTION_INFO_V1(bt_page_stats);
4242
#define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX)
4343
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
4444

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

contrib/pgstattuple/pgstatindex.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,6 @@ PG_FUNCTION_INFO_V1(pgstatginindex);
5757
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
5858
#define IS_GIN(r) ((r)->rd_rel->relam == GIN_AM_OID)
5959

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

0 commit comments

Comments
 (0)
0