Skip to content

Instantly share code, notes, and snippets.

@danielgustafsson
Created April 28, 2016 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielgustafsson/b05288c5a99cac6e3512a9c2a0e6cc9a to your computer and use it in GitHub Desktop.
Save danielgustafsson/b05288c5a99cac6e3512a9c2a0e6cc9a to your computer and use it in GitHub Desktop.
diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c
index d088ce5..4983bbb 100644
--- a/contrib/pageinspect/btreefuncs.c
+++ b/contrib/pageinspect/btreefuncs.c
@@ -43,11 +43,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 9f1377c..6084589 100644
--- a/contrib/pgstattuple/pgstatindex.c
+++ b/contrib/pgstattuple/pgstatindex.c
@@ -58,16 +58,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().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment