aboutsummaryrefslogtreecommitdiff
path: root/src/backend/main/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/main/main.c')
-rw-r--r--src/backend/main/main.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index b1be0781412..9c79e7b78d9 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.49 2001/11/05 17:46:25 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/main/main.c,v 1.50 2002/04/03 05:39:29 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -21,9 +21,7 @@
#include <pwd.h>
#include <unistd.h>
-#if defined(USE_LOCALE) || defined(ENABLE_NLS)
#include <locale.h>
-#endif
#if defined(__alpha) && defined(__osf__)
#include <sys/sysinfo.h>
@@ -122,11 +120,25 @@ main(int argc, char *argv[])
new_argv[i] = strdup(argv[i]);
new_argv[argc] = NULL;
- /* Initialize NLS settings so we can give localized error messages */
-#ifdef ENABLE_NLS
+ /*
+ * Set up locale information from environment. Note that CTYPE
+ * and COLLATE will be overridden later from pg_control if we are
+ * in an already-initialized database. We set them here so that
+ * they will be available to fill pg_control during initdb. The
+ * other ones will get reset later in ResetAllOptions, but we set
+ * them here to get already localized behavior during startup
+ * (e.g., error messages).
+ */
+ setlocale(LC_COLLATE, "");
+ setlocale(LC_CTYPE, "");
#ifdef LC_MESSAGES
setlocale(LC_MESSAGES, "");
#endif
+ setlocale(LC_MONETARY, "");
+ setlocale(LC_NUMERIC, "");
+ setlocale(LC_TIME, "");
+
+#ifdef ENABLE_NLS
bindtextdomain("postgres", LOCALEDIR);
textdomain("postgres");
#endif
@@ -179,20 +191,6 @@ main(int argc, char *argv[])
}
/*
- * Set up locale information from environment, in only the categories
- * needed by Postgres; leave other categories set to default "C".
- * (Note that CTYPE and COLLATE will be overridden later from
- * pg_control if we are in an already-initialized database. We set
- * them here so that they will be available to fill pg_control during
- * initdb.)
- */
-#ifdef USE_LOCALE
- setlocale(LC_CTYPE, "");
- setlocale(LC_COLLATE, "");
- setlocale(LC_MONETARY, "");
-#endif
-
- /*
* Now dispatch to one of PostmasterMain, PostgresMain, or
* BootstrapMain depending on the program name (and possibly first
* argument) we were called with. The lack of consistency here is