From: Tom Lane Date: Wed, 27 Feb 2008 17:44:27 +0000 (+0000) Subject: If RelationBuildDesc() fails to open a critical system index, PANIC with X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=dbea05eb1fe96f118112637847d7dac8ef5b9687;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 5361790ccd..d88fa5478e 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -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)