summaryrefslogtreecommitdiff
path: root/contrib/pageinspect/rawpage.c
diff options
context:
space:
mode:
authorAlvaro Herrera2018-05-09 17:03:43 +0000
committerAlvaro Herrera2018-05-09 17:22:59 +0000
commitbef5fcc36be3d08ec123889a0c82f5e07a63ff88 (patch)
treebf5ba99d50fc87d6fd0c441e32bbbe3308dc2cbd /contrib/pageinspect/rawpage.c
parentc8478f4fd908b5a122b5638018bbb749ac0e862f (diff)
pgstatindex, pageinspect: handle partitioned indexes
Commit 8b08f7d4820f failed to update these modules to at least give non-broken error messages for partitioned indexes. Add appropriate error support to them. Peter G. was complaining about a problem of unfriendly error messages; while we haven't fixed that yet, subsequent discussion let to discovery of these unhandled cases. Author: Michaƫl Paquier Reported-by: Peter Geoghegan Discussion: https://postgr.es/m/CAH2-WzkOKptQiE51Bh4_xeEHhaBwHkZkGtKizrFMgEkfUuRRQg@mail.gmail.com
Diffstat (limited to 'contrib/pageinspect/rawpage.c')
-rw-r--r--contrib/pageinspect/rawpage.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c
index 72f1d21e1b7..d7bf782ccd5 100644
--- a/contrib/pageinspect/rawpage.c
+++ b/contrib/pageinspect/rawpage.c
@@ -128,6 +128,11 @@ get_raw_page_internal(text *relname, ForkNumber forknum, BlockNumber blkno)
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot get raw page from partitioned table \"%s\"",
RelationGetRelationName(rel))));
+ if (rel->rd_rel->relkind == RELKIND_PARTITIONED_INDEX)
+ ereport(ERROR,
+ (errcode(ERRCODE_WRONG_OBJECT_TYPE),
+ errmsg("cannot get raw page from partitioned index \"%s\"",
+ RelationGetRelationName(rel))));
/*
* Reject attempts to read non-local temporary relations; we would be