Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf56e8fe

Browse files
author
Thomas G. Lockhart
committed
Add fields in the control file to check for whether the backend was
compiled for integer date/time storage and to check the length of storage for the locale fields in the same data structure.Slightly reword some of the error messages to be more accurate on possible recovery options (e.g. recompile *or* re-initdb).Bump version number on this file.
1 parentc05f29e commitf56e8fe

File tree

1 file changed

+52
-5
lines changed
  • src/backend/access/transam

1 file changed

+52
-5
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
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)
20882088
ControlFile->catalog_version_no=CATALOG_VERSION_NO;
20892089
ControlFile->blcksz=BLCKSZ;
20902090
ControlFile->relseg_size=RELSEG_SIZE;
2091+
2092+
ControlFile->nameDataLen=NAMEDATALEN;
2093+
ControlFile->funcMaxArgs=FUNC_MAX_ARGS;
2094+
2095+
#ifdefHAVE_INT64_TIMESTAMP
2096+
ControlFile->enableIntTimes= TRUE;
2097+
#else
2098+
ControlFile->enableIntTimes= FALSE;
2099+
#endif
2100+
2101+
ControlFile->localeBuflen=LOCALE_NAME_BUFLEN;
20912102
localeptr=setlocale(LC_COLLATE,NULL);
20922103
if (!localeptr)
20932104
elog(PANIC,"invalid LC_COLLATE setting");
@@ -2106,7 +2117,7 @@ WriteControlFile(void)
21062117
elog(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.",
21112122
ControlFile->lc_collate);
21122123

@@ -2207,7 +2218,7 @@ ReadControlFile(void)
22072218
if (ControlFile->catalog_version_no!=CATALOG_VERSION_NO)
22082219
elog(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.",
22122223
ControlFile->catalog_version_no,CATALOG_VERSION_NO);
22132224
if (ControlFile->blcksz!=BLCKSZ)
@@ -2220,11 +2231,47 @@ ReadControlFile(void)
22202231
elog(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 orinitdb.",
22242235
ControlFile->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+
#ifdefHAVE_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+
22252272
if (setlocale(LC_COLLATE,ControlFile->lc_collate)==NULL)
22262273
elog(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.",
22302277
ControlFile->lc_collate);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp