aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:44:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:44:19 +0000
commit1743778d04cfbbdd7fc89f1130979658fa9fae4f (patch)
tree3456c916bb9e62e31d726abb9e251c8a596c955b /src
parent00941eea77c90a492fa53615713975f46f7ff3ae (diff)
downloadpostgresql-1743778d04cfbbdd7fc89f1130979658fa9fae4f.tar.gz
postgresql-1743778d04cfbbdd7fc89f1130979658fa9fae4f.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.
Diffstat (limited to 'src')
-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 71abf31f099..ca4305c60ba 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.266 2008/01/01 19:45:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.267 2008/02/27 17:44:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2550,7 +2550,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)