Skip to content

Commit 1743778

Browse files
committed
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.
1 parent 00941ee commit 1743778

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/utils/cache/relcache.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.266 2008/01/01 19:45:53 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.267 2008/02/27 17:44:19 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2550,7 +2550,10 @@ RelationCacheInitializePhase2(void)
25502550

25512551
#define LOAD_CRIT_INDEX(indexoid) \
25522552
do { \
2553-
ird = RelationBuildDesc((indexoid), NULL); \
2553+
ird = RelationBuildDesc(indexoid, NULL); \
2554+
if (ird == NULL) \
2555+
elog(PANIC, "could not open critical system index %u", \
2556+
indexoid); \
25542557
ird->rd_isnailed = true; \
25552558
ird->rd_refcnt = 1; \
25562559
} while (0)

0 commit comments

Comments
 (0)