]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
If RelationBuildDesc() fails to open a critical system index, PANIC with
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Feb 2008 17:44:51 +0000 (17:44 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 27 Feb 2008 17:44:51 +0000 (17:44 +0000)
a relevant error message instead of just dumping core.  Odd that nobody
reported this before Darren Reed.

src/backend/utils/cache/relcache.c

index 7cd093d2faf8ef2cc3995fb89e662dd41301cd7b..d1d3d8a901a9cf7f290c98b4390fe2ecbeba0527 100644 (file)
@@ -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)