postgres.git / summary / log / commit / refs
commit a840c14286bcd2ea3241ca7ff0aa2c28f0472418
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Mon May 02 07:07:49 2016 +0000
First released in: 9.6.0, 9.1.22, 9.2.17, 9.3.13, 9.4.8, 9.5.3
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
contrib/pageinspect/btreefuncs.c | 5 -----
contrib/pgstattuple/pgstatindex.c | 10 ----------
2 files changed, 15 deletions(-)
diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c
index c1e83f301b4..47fc1df0ee4 100644
--- a/contrib/pageinspect/btreefuncs.c
+++ b/contrib/pageinspect/btreefuncs.c
@@ -42,11 +42,6 @@ PG_FUNCTION_INFO_V1(bt_page_stats);
#define IS_INDEX(r) ((r)->rd_rel->relkind == RELKIND_INDEX)
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
-#define CHECK_PAGE_OFFSET_RANGE(pg, offnum) { \
- if ( !(FirstOffsetNumber <= (offnum) && \
- (offnum) <= PageGetMaxOffsetNumber(pg)) ) \
- elog(ERROR, "page offset number out of range"); }
-
/* note: BlockNumber is unsigned, hence can't be negative */
#define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \
if ( RelationGetNumberOfBlocks(rel) <= (BlockNumber) (blkno) ) \
diff --git a/contrib/pgstattuple/pgstatindex.c b/contrib/pgstattuple/pgstatindex.c
index 8d9d81610ec..2f2ce497e48 100644
--- a/contrib/pgstattuple/pgstatindex.c
+++ b/contrib/pgstattuple/pgstatindex.c
@@ -57,16 +57,6 @@ PG_FUNCTION_INFO_V1(pgstatginindex);
#define IS_BTREE(r) ((r)->rd_rel->relam == BTREE_AM_OID)
#define IS_GIN(r) ((r)->rd_rel->relam == GIN_AM_OID)
-#define CHECK_PAGE_OFFSET_RANGE(pg, offnum) { \
- if ( !(FirstOffsetNumber <= (offnum) && \
- (offnum) <= PageGetMaxOffsetNumber(pg)) ) \
- elog(ERROR, "page offset number out of range"); }
-
-/* note: BlockNumber is unsigned, hence can't be negative */
-#define CHECK_RELATION_BLOCK_RANGE(rel, blkno) { \
- if ( RelationGetNumberOfBlocks(rel) <= (BlockNumber) (blkno) ) \
- elog(ERROR, "block number out of range"); }
-
/* ------------------------------------------------
* A structure for a whole btree index statistics
* used by pgstatindex().
[parent: 72edc8ffeb0e]