If RelationBuildDesc() fails to open a critical system index, PANIC with
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Feb 2008 17:45:02 +0000 (17:45 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Feb 2008 17:45:02 +0000 (17:45 +0000)
a relevant error message instead of just dumping core.  Odd that nobody
reported this before Darren Reed.

src/backend/utils/cache/relcache.c

index 5361790ccd6be3dd1f1b3c4af4aeef4589e30857..d88fa5478e80df06d46fa83a7f01162465359224 100644 (file)
@@ -2550,7 +2550,10 @@ RelationCacheInitializePhase2(void)
 
 #define LOAD_CRIT_INDEX(indexoid) \
                do { \
-                       ird = RelationBuildDesc((indexoid), NULL); \
+                       ird = RelationBuildDesc(indexoid, NULL); \
+                       if (ird == NULL) \
+                               elog(PANIC, "could not open critical system index %u", \
+                                        indexoid); \
                        ird->rd_isnailed = true; \
                        ird->rd_refcnt = 1; \
                } while (0)