@@ -99,42 +99,24 @@ main(int argc, char *argv[])
99
99
MemoryContextInit ();
100
100
101
101
/*
102
- * Set up locale information from environment. Note that LC_CTYPE and
103
- * LC_COLLATE will be overridden later from pg_control if we are in an
104
- * already-initialized database. We set them here so that they will be
105
- * available to fill pg_control during initdb. LC_MESSAGES will get set
106
- * later during GUC option processing, but we set it here to allow startup
107
- * error messages to be localized.
102
+ * Set up locale information
108
103
*/
109
-
110
104
set_pglocale_pgservice (argv [0 ], PG_TEXTDOMAIN ("postgres" ));
111
105
112
- #ifdef WIN32
113
-
114
106
/*
115
- * Windows uses codepages rather than the environment, so we work around
116
- * that by querying the environment explicitly first for LC_COLLATE and
117
- * LC_CTYPE. We have to do this because initdb passes those values in the
118
- * environment. If there is nothing there we fall back on the codepage.
107
+ * In the postmaster, absorb the environment values for LC_COLLATE and
108
+ * LC_CTYPE. Individual backends will change these later to settings
109
+ * taken from pg_database, but the postmaster cannot do that. If we leave
110
+ * these set to "C" then message localization might not work well in the
111
+ * postmaster.
119
112
*/
120
- {
121
- char * env_locale ;
122
-
123
- if ((env_locale = getenv ("LC_COLLATE" )) != NULL )
124
- init_locale ("LC_COLLATE" , LC_COLLATE , env_locale );
125
- else
126
- init_locale ("LC_COLLATE" , LC_COLLATE , "" );
127
-
128
- if ((env_locale = getenv ("LC_CTYPE" )) != NULL )
129
- init_locale ("LC_CTYPE" , LC_CTYPE , env_locale );
130
- else
131
- init_locale ("LC_CTYPE" , LC_CTYPE , "" );
132
- }
133
- #else
134
113
init_locale ("LC_COLLATE" , LC_COLLATE , "" );
135
114
init_locale ("LC_CTYPE" , LC_CTYPE , "" );
136
- #endif
137
115
116
+ /*
117
+ * LC_MESSAGES will get set later during GUC option processing, but we set
118
+ * it here to allow startup error messages to be localized.
119
+ */
138
120
#ifdef LC_MESSAGES
139
121
init_locale ("LC_MESSAGES" , LC_MESSAGES , "" );
140
122
#endif
0 commit comments