]> granicus.if.org Git - postgresql/commitdiff
Remove unused macros.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 2 May 2016 07:07:49 +0000 (10:07 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Mon, 2 May 2016 07:09:08 +0000 (10:09 +0300)
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
contrib/pgstattuple/pgstatindex.c

index 41897ec6c4a9a16c46526138ae2488ff02f17e47..d33d59fb6bff2bba42cad11206ba2cae91647e16 100644 (file)
@@ -48,11 +48,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) ) \
index 0aa517a870a51fe7e01ad42c45ac7b05dd3462c5..8851d0c8631b9ccc3822f2198b5ce28ed436510a 100644 (file)
@@ -45,16 +45,6 @@ PG_FUNCTION_INFO_V1(pg_relpages);
 #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) ) \
-                        elog(ERROR, "block number out of range"); }
-
 /* ------------------------------------------------
  * A structure for a whole btree index statistics
  * used by pgstatindex().