From: Tom Lane Date: Wed, 27 Feb 2008 17:45:02 +0000 (+0000) Subject: If RelationBuildDesc() fails to open a critical system index, PANIC with X-Git-Tag: REL7_4_20~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69e676f77d8ff495326ecd09420a6628da503725;p=postgresql 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 d28875b1da..cdfc2bf21e 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.190 2003/09/25 06:58:05 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.190.2.1 2008/02/27 17:45:02 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2381,6 +2381,9 @@ RelationCacheInitializePhase2(void) buildinfo.infotype = INFO_RELNAME; \ buildinfo.i.info_name = (indname); \ ird = RelationBuildDesc(buildinfo, NULL); \ + if (ird == NULL) \ + elog(PANIC, "could not open critical system index \"%s\"", \ + indname); \ ird->rd_isnailed = 1; \ RelationSetReferenceCount(ird, 1); \ } while (0)