77 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88 * Portions Copyright (c) 1994, Regents of the University of California
99 *
10- * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.91 2002/04/03 05:39:29 petere Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.92 2002/04/21 19:08:02 thomas Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -2088,6 +2088,17 @@ WriteControlFile(void)
20882088ControlFile -> catalog_version_no = CATALOG_VERSION_NO ;
20892089ControlFile -> blcksz = BLCKSZ ;
20902090ControlFile -> relseg_size = RELSEG_SIZE ;
2091+
2092+ ControlFile -> nameDataLen = NAMEDATALEN ;
2093+ ControlFile -> funcMaxArgs = FUNC_MAX_ARGS ;
2094+
2095+ #ifdef HAVE_INT64_TIMESTAMP
2096+ ControlFile -> enableIntTimes = TRUE;
2097+ #else
2098+ ControlFile -> enableIntTimes = FALSE;
2099+ #endif
2100+
2101+ ControlFile -> localeBuflen = LOCALE_NAME_BUFLEN ;
20912102localeptr = setlocale (LC_COLLATE ,NULL );
20922103if (!localeptr )
20932104elog (PANIC ,"invalid LC_COLLATE setting" );
@@ -2106,7 +2117,7 @@ WriteControlFile(void)
21062117elog (WARNING ,"Initializing database with %s collation order."
21072118"\n\tThis locale setting will prevent use of index optimization for"
21082119"\n\tLIKE and regexp searches. If you are concerned about speed of"
2109- "\n\tsuch queries, you may wish to set LC_COLLATE to \"C\" and"
2120+ "\n\tsuch queries, you may wish to set LC_COLLATE to \"C\" and"
21102121"\n\tre-initdb. For more information see the Administrator's Guide." ,
21112122ControlFile -> lc_collate );
21122123
@@ -2207,7 +2218,7 @@ ReadControlFile(void)
22072218if (ControlFile -> catalog_version_no != CATALOG_VERSION_NO )
22082219elog (PANIC ,
22092220"The database cluster was initialized with CATALOG_VERSION_NO %d,\n"
2210- "\tbut the backend was compiled with CATALOG_VERSION_NO %d.\n"
2221+ "\tbut the backend was compiled with CATALOG_VERSION_NO %d.\n"
22112222"\tIt looks like you need to initdb." ,
22122223ControlFile -> catalog_version_no ,CATALOG_VERSION_NO );
22132224if (ControlFile -> blcksz != BLCKSZ )
@@ -2220,11 +2231,47 @@ ReadControlFile(void)
22202231elog (PANIC ,
22212232"The database cluster was initialized with RELSEG_SIZE %d,\n"
22222233"\tbut the backend was compiled with RELSEG_SIZE %d.\n"
2223- "\tIt looks like you need to initdb." ,
2234+ "\tIt looks like you need torecompile or initdb." ,
22242235ControlFile -> relseg_size ,RELSEG_SIZE );
2236+
2237+ if (ControlFile -> nameDataLen != NAMEDATALEN )
2238+ elog (PANIC ,
2239+ "The database cluster was initialized with NAMEDATALEN %d,\n"
2240+ "\tbut the backend was compiled with NAMEDATALEN %d.\n"
2241+ "\tIt looks like you need to recompile or initdb." ,
2242+ ControlFile -> nameDataLen ,NAMEDATALEN );
2243+
2244+ if (ControlFile -> funcMaxArgs != FUNC_MAX_ARGS )
2245+ elog (PANIC ,
2246+ "The database cluster was initialized with FUNC_MAX_ARGS %d,\n"
2247+ "\tbut the backend was compiled with FUNC_MAX_ARGS %d.\n"
2248+ "\tIt looks like you need to recompile or initdb." ,
2249+ ControlFile -> funcMaxArgs ,FUNC_MAX_ARGS );
2250+
2251+ #ifdef HAVE_INT64_TIMESTAMP
2252+ if (ControlFile -> enableIntTimes != TRUE)
2253+ elog (PANIC ,
2254+ "The database cluster was initialized without HAVE_INT64_TIMESTAMP\n"
2255+ "\tbut the backend was compiled with HAVE_INT64_TIMESTAMP.\n"
2256+ "\tIt looks like you need to recompile or initdb." );
2257+ #else
2258+ if (ControlFile -> enableIntTimes != FALSE)
2259+ elog (PANIC ,
2260+ "The database cluster was initialized with HAVE_INT64_TIMESTAMP\n"
2261+ "\tbut the backend was compiled without HAVE_INT64_TIMESTAMP.\n"
2262+ "\tIt looks like you need to recompile or initdb." );
2263+ #endif
2264+
2265+ if (ControlFile -> localeBuflen != LOCALE_NAME_BUFLEN )
2266+ elog (PANIC ,
2267+ "The database cluster was initialized with LOCALE_NAME_BUFLEN %d,\n"
2268+ "\tbut the backend was compiled with LOCALE_NAME_BUFLEN %d.\n"
2269+ "\tIt looks like you need to initdb." ,
2270+ ControlFile -> localeBuflen ,LOCALE_NAME_BUFLEN );
2271+
22252272if (setlocale (LC_COLLATE ,ControlFile -> lc_collate )== NULL )
22262273elog (PANIC ,
2227- "The database cluster was initialized with LC_COLLATE '%s',\n"
2274+ "The database cluster was initialized with LC_COLLATE '%s',\n"
22282275"\twhich is not recognized by setlocale().\n"
22292276"\tIt looks like you need to initdb." ,
22302277ControlFile -> lc_collate );