From: Tom Lane Date: Wed, 27 Feb 2008 17:44:41 +0000 (+0000) Subject: If RelationBuildDesc() fails to open a critical system index, PANIC with X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=58e8f77efb4ee180299444d4ae2a9034c63cea7c;p=users%2Fbernd%2Fpostgres.git If RelationBuildDesc() fails to open a critical system index, PANIC with a relevant error message instead of just dumping core. Odd that nobody reported this before Darren Reed. --- diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 62d4482574..04c53673bb 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -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)