aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:44:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:44:41 +0000
commitf40d8b5ef43c26aa0e8d45bd9acb36b197258179 (patch)
tree775720ce035c7111f75d52a4c8f85b7fa51c383c
parentbac65d5240d6fbf16e82bdd202439e0dbdb72a59 (diff)
downloadpostgresql-f40d8b5ef43c26aa0e8d45bd9acb36b197258179.tar.gz
postgresql-f40d8b5ef43c26aa0e8d45bd9acb36b197258179.zip
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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 9334cb38cd9..1336f47389a 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.230.2.4 2006/11/05 23:40:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.230.2.5 2008/02/27 17:44:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2239,7 +2239,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)