aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:44:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:44:33 +0000
commitc05c8fe5d7e260aabcb54ced95dbb0cb79a4283f (patch)
tree61a5fa5ea9575c0f540d1d3adaff9b6b83d49bf2 /src
parent1558a043abe787779a07e51d530aac0bfde38d8c (diff)
downloadpostgresql-c05c8fe5d7e260aabcb54ced95dbb0cb79a4283f.tar.gz
postgresql-c05c8fe5d7e260aabcb54ced95dbb0cb79a4283f.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 65cd1e72907..c333c049e3a 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.250 2006/11/05 23:40:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.250.2.1 2008/02/27 17:44:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2385,7 +2385,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)