Tom Lane wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > I have two questions.  First, setlocale() seemed to be inconsistently
> > set inside and outside of ENABLE_NLS.  I assume the proper location is
> > inside.
> 
> Please do *not* go adding setlocale calls that were not there before.
> You *will* break things.
> 
> > !         setlocale(LC_ALL, "");
>             ^^^^^^^^^^^^^^^^^^^^^
> 
> Putting this call in the backend is a very serious mistake.  It might be
> okay in clients, but not in the backend.

OK, patch applied.  Turns out it was only added for the backend
("postgres").

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/port/path.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/port/path.c,v
retrieving revision 1.12
diff -c -c -r1.12 path.c
*** src/port/path.c     25 May 2004 01:00:30 -0000      1.12
--- src/port/path.c     25 May 2004 01:40:36 -0000
***************
*** 251,257 ****
        char path[MAXPGPATH];
        char my_exec_path[MAXPGPATH];
  
!       setlocale(LC_ALL, "");
        if (find_my_exec(argv0, my_exec_path) < 0)
                return;
                
--- 251,260 ----
        char path[MAXPGPATH];
        char my_exec_path[MAXPGPATH];
  
!       /* don't set LC_ALL in the backend */
!       if (strcmp(app, "postgres") != 0)
!               setlocale(LC_ALL, "");
! 
        if (find_my_exec(argv0, my_exec_path) < 0)
                return;
                
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to