aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:45:02 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-02-27 17:45:02 +0000
commit69e676f77d8ff495326ecd09420a6628da503725 (patch)
tree828bcc0d92d94014ae5ee3ecf158de37c54514a1
parenta45d896b017a8ef852653f3a8fb3ea1b934ac95a (diff)
downloadpostgresql-69e676f77d8ff495326ecd09420a6628da503725.tar.gz
postgresql-69e676f77d8ff495326ecd09420a6628da503725.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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index d28875b1da9..cdfc2bf21e9 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.190 2003/09/25 06:58:05 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.190.2.1 2008/02/27 17:45:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2381,6 +2381,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 = 1; \
RelationSetReferenceCount(ird, 1); \
} while (0)