summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2008-02-27 17:44:51 +0000
committerTom Lane2008-02-27 17:44:51 +0000
commitafe57e993bea1c63527e8cde2971cb9d2fde9e75 (patch)
tree014485d177c1b5dca4d80f01f0733fa112faf40c
parentcaf9e44a86057f3a2c6f161e0fadbaa82c946ee2 (diff)
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.
-rw-r--r--src/backend/utils/cache/relcache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 7cd093d2faf..d1d3d8a901a 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.215.4.1 2006/01/19 20:28:57 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.215.4.2 2008/02/27 17:44:51 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2404,6 +2404,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 = true; \
ird->rd_refcnt = 1; \
} while (0)