If RelationBuildDesc() fails to open a critical system index, PANIC with
authorTom Lane <[email protected]>
Wed, 27 Feb 2008 17:44:41 +0000 (17:44 +0000)
committerTom Lane <[email protected]>
Wed, 27 Feb 2008 17:44:41 +0000 (17:44 +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 62d4482574c053b81e240251a13a94bbaa1a309a..04c53673bb88b78f034818a8a865b21c15b1e0c4 100644 (file)
@@ -2239,7 +2239,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)