From 69e676f77d8ff495326ecd09420a6628da503725 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 27 Feb 2008 17:45:02 +0000 Subject: [PATCH] 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. --- src/backend/utils/cache/relcache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index d28875b1da9..cdfc2bf21e9 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)