Thread: pg_ctl-related "fixes"

pg_ctl-related "fixes"

From
"Serguei A. Mokhov"
Date:
Hello Bruce,

The first commit of the two below mentions "Add locale to pg_ctl.c", where
actually no pg_ctl were touched in this commit. Did you miss my locale
changes there (ie. <locale.h> and #ifdef NLS_...)? As of now these changes
are still not in.

The scond commit, what does it change exactly, especially in
nls-global.mk?

Thanks,

-s

On Tue, 1 Jun 2004 pgsql-committers-owner@postgresql.org wrote:

> Date: Mon, 31 May 2004 23:54:16 -0300 (ADT)
> From: momjian@svr1.postgresql.org (Bruce Momjian)
> To: pgsql-committers@postgresql.org
> Subject: pgsql-server: Remove init_nls() functions, call set_pglocale() directly.
> Message-ID: <20040601025416.4EC04D1B349@svr1.postgresql.org>
>
> Log Message:
> -----------
> Remove init_nls() functions, call set_pglocale() directly.
>
> Add locale to pg_ctl.c.
>
> Modified Files:
> --------------
>     pgsql-server/src/bin/initdb:
>         initdb.c (r1.33 -> r1.34)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/initdb/initdb.c.diff?r1=1.33&r2=1.34)
>     pgsql-server/src/bin/scripts:
>         clusterdb.c (r1.7 -> r1.8)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/clusterdb.c.diff?r1=1.7&r2=1.8)
>         common.c (r1.8 -> r1.9)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/common.c.diff?r1=1.8&r2=1.9)
>         common.h (r1.7 -> r1.8)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/common.h.diff?r1=1.7&r2=1.8)
>         createdb.c (r1.9 -> r1.10)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createdb.c.diff?r1=1.9&r2=1.10)
>         createlang.c (r1.10 -> r1.11)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createlang.c.diff?r1=1.10&r2=1.11)
>         createuser.c (r1.11 -> r1.12)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createuser.c.diff?r1=1.11&r2=1.12)
>         dropdb.c (r1.10 -> r1.11)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/dropdb.c.diff?r1=1.10&r2=1.11)
>         droplang.c (r1.9 -> r1.10)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/droplang.c.diff?r1=1.9&r2=1.10)
>         dropuser.c (r1.9 -> r1.10)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/dropuser.c.diff?r1=1.9&r2=1.10)
>         vacuumdb.c (r1.7 -> r1.8)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/vacuumdb.c.diff?r1=1.7&r2=1.8)


> ------------------------------
>
> Date: Tue,  1 Jun 2004 00:32:49 -0300 (ADT)
> From: momjian@svr1.postgresql.org (Bruce Momjian)
> To: pgsql-committers@postgresql.org
> Subject: pgsql-server: More locale fixes for pg_ctl.
> Message-ID: <20040601033249.37CCED1BAA0@svr1.postgresql.org>
>
> Log Message:
> -----------
> More locale fixes for pg_ctl.
>
> Modified Files:
> --------------
>     pgsql-server/src:
>         nls-global.mk (r1.9 -> r1.10)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/nls-global.mk.diff?r1=1.9&r2=1.10)
>     pgsql-server/src/bin/pg_ctl:
>         pg_ctl.c (r1.3 -> r1.4)
>         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/pg_ctl/pg_ctl.c.diff?r1=1.3&r2=1.4)


--
Serguei A. Mokhov            |  /~\    The ASCII
Computer Science Department  |  \ / Ribbon Campaign
Concordia University         |   X    Against HTML
Montreal, Quebec, Canada     |  / \      Email!


Re: pg_ctl-related "fixes"

From
Bruce Momjian
Date:
The first commit just did the init_nls changes while the second was all
pg_ctl.  Sorry.

---------------------------------------------------------------------------

Serguei A. Mokhov wrote:
> Hello Bruce,
>
> The first commit of the two below mentions "Add locale to pg_ctl.c", where
> actually no pg_ctl were touched in this commit. Did you miss my locale
> changes there (ie. <locale.h> and #ifdef NLS_...)? As of now these changes
> are still not in.
>
> The scond commit, what does it change exactly, especially in
> nls-global.mk?
>
> Thanks,
>
> -s
>
> On Tue, 1 Jun 2004 pgsql-committers-owner@postgresql.org wrote:
>
> > Date: Mon, 31 May 2004 23:54:16 -0300 (ADT)
> > From: momjian@svr1.postgresql.org (Bruce Momjian)
> > To: pgsql-committers@postgresql.org
> > Subject: pgsql-server: Remove init_nls() functions, call set_pglocale() directly.
> > Message-ID: <20040601025416.4EC04D1B349@svr1.postgresql.org>
> >
> > Log Message:
> > -----------
> > Remove init_nls() functions, call set_pglocale() directly.
> >
> > Add locale to pg_ctl.c.
> >
> > Modified Files:
> > --------------
> >     pgsql-server/src/bin/initdb:
> >         initdb.c (r1.33 -> r1.34)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/initdb/initdb.c.diff?r1=1.33&r2=1.34)
> >     pgsql-server/src/bin/scripts:
> >         clusterdb.c (r1.7 -> r1.8)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/clusterdb.c.diff?r1=1.7&r2=1.8)
> >         common.c (r1.8 -> r1.9)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/common.c.diff?r1=1.8&r2=1.9)
> >         common.h (r1.7 -> r1.8)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/common.h.diff?r1=1.7&r2=1.8)
> >         createdb.c (r1.9 -> r1.10)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createdb.c.diff?r1=1.9&r2=1.10)
> >         createlang.c (r1.10 -> r1.11)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createlang.c.diff?r1=1.10&r2=1.11)
> >         createuser.c (r1.11 -> r1.12)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createuser.c.diff?r1=1.11&r2=1.12)
> >         dropdb.c (r1.10 -> r1.11)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/dropdb.c.diff?r1=1.10&r2=1.11)
> >         droplang.c (r1.9 -> r1.10)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/droplang.c.diff?r1=1.9&r2=1.10)
> >         dropuser.c (r1.9 -> r1.10)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/dropuser.c.diff?r1=1.9&r2=1.10)
> >         vacuumdb.c (r1.7 -> r1.8)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/vacuumdb.c.diff?r1=1.7&r2=1.8)
>
>
> > ------------------------------
> >
> > Date: Tue,  1 Jun 2004 00:32:49 -0300 (ADT)
> > From: momjian@svr1.postgresql.org (Bruce Momjian)
> > To: pgsql-committers@postgresql.org
> > Subject: pgsql-server: More locale fixes for pg_ctl.
> > Message-ID: <20040601033249.37CCED1BAA0@svr1.postgresql.org>
> >
> > Log Message:
> > -----------
> > More locale fixes for pg_ctl.
> >
> > Modified Files:
> > --------------
> >     pgsql-server/src:
> >         nls-global.mk (r1.9 -> r1.10)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/nls-global.mk.diff?r1=1.9&r2=1.10)
> >     pgsql-server/src/bin/pg_ctl:
> >         pg_ctl.c (r1.3 -> r1.4)
> >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/pg_ctl/pg_ctl.c.diff?r1=1.3&r2=1.4)
>
>
> --
> Serguei A. Mokhov            |  /~\    The ASCII
> Computer Science Department  |  \ / Ribbon Campaign
> Concordia University         |   X    Against HTML
> Montreal, Quebec, Canada     |  / \      Email!
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pg_ctl-related "fixes"

From
"Serguei A. Mokhov"
Date:
On Tue, 1 Jun 2004, Bruce Momjian wrote:

> Date: Tue, 1 Jun 2004 15:04:30 -0400 (EDT)
>
> The first commit just did the init_nls changes while the second was all
> pg_ctl.  Sorry.

But the locale and NLS issues for pg_ctl still remain unfixed.

-s

> ---------------------------------------------------------------------------
>
> Serguei A. Mokhov wrote:
> > Hello Bruce,
> >
> > The first commit of the two below mentions "Add locale to pg_ctl.c", where
> > actually no pg_ctl were touched in this commit. Did you miss my locale
> > changes there (ie. <locale.h> and #ifdef NLS_...)? As of now these changes
> > are still not in.
> >
> > The scond commit, what does it change exactly, especially in
> > nls-global.mk?
> >
> > Thanks,
> >
> > -s
> >
> > On Tue, 1 Jun 2004 pgsql-committers-owner@postgresql.org wrote:
> >
> > > Date: Mon, 31 May 2004 23:54:16 -0300 (ADT)
> > > From: momjian@svr1.postgresql.org (Bruce Momjian)
> > > To: pgsql-committers@postgresql.org
> > > Subject: pgsql-server: Remove init_nls() functions, call set_pglocale() directly.
> > > Message-ID: <20040601025416.4EC04D1B349@svr1.postgresql.org>
> > >
> > > Log Message:
> > > -----------
> > > Remove init_nls() functions, call set_pglocale() directly.
> > >
> > > Add locale to pg_ctl.c.
> > >
> > > Modified Files:
> > > --------------
> > >     pgsql-server/src/bin/initdb:
> > >         initdb.c (r1.33 -> r1.34)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/initdb/initdb.c.diff?r1=1.33&r2=1.34)
> > >     pgsql-server/src/bin/scripts:
> > >         clusterdb.c (r1.7 -> r1.8)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/clusterdb.c.diff?r1=1.7&r2=1.8)
> > >         common.c (r1.8 -> r1.9)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/common.c.diff?r1=1.8&r2=1.9)
> > >         common.h (r1.7 -> r1.8)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/common.h.diff?r1=1.7&r2=1.8)
> > >         createdb.c (r1.9 -> r1.10)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createdb.c.diff?r1=1.9&r2=1.10)
> > >         createlang.c (r1.10 -> r1.11)
> > >
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createlang.c.diff?r1=1.10&r2=1.11)
> > >         createuser.c (r1.11 -> r1.12)
> > >
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/createuser.c.diff?r1=1.11&r2=1.12)
> > >         dropdb.c (r1.10 -> r1.11)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/dropdb.c.diff?r1=1.10&r2=1.11)
> > >         droplang.c (r1.9 -> r1.10)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/droplang.c.diff?r1=1.9&r2=1.10)
> > >         dropuser.c (r1.9 -> r1.10)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/dropuser.c.diff?r1=1.9&r2=1.10)
> > >         vacuumdb.c (r1.7 -> r1.8)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/scripts/vacuumdb.c.diff?r1=1.7&r2=1.8)
> >
> >
> > > ------------------------------
> > >
> > > Date: Tue,  1 Jun 2004 00:32:49 -0300 (ADT)
> > > From: momjian@svr1.postgresql.org (Bruce Momjian)
> > > To: pgsql-committers@postgresql.org
> > > Subject: pgsql-server: More locale fixes for pg_ctl.
> > > Message-ID: <20040601033249.37CCED1BAA0@svr1.postgresql.org>
> > >
> > > Log Message:
> > > -----------
> > > More locale fixes for pg_ctl.
> > >
> > > Modified Files:
> > > --------------
> > >     pgsql-server/src:
> > >         nls-global.mk (r1.9 -> r1.10)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/nls-global.mk.diff?r1=1.9&r2=1.10)
> > >     pgsql-server/src/bin/pg_ctl:
> > >         pg_ctl.c (r1.3 -> r1.4)
> > >         (http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/pg_ctl/pg_ctl.c.diff?r1=1.3&r2=1.4)

--
Serguei A. Mokhov            |  /~\    The ASCII
Computer Science Department  |  \ / Ribbon Campaign
Concordia University         |   X    Against HTML
Montreal, Quebec, Canada     |  / \      Email!


Re: pg_ctl-related "fixes"

From
Bruce Momjian
Date:
Serguei A. Mokhov wrote:
> On Tue, 1 Jun 2004, Bruce Momjian wrote:
>
> > Date: Tue, 1 Jun 2004 15:04:30 -0400 (EDT)
> >
> > The first commit just did the init_nls changes while the second was all
> > pg_ctl.  Sorry.
>
> But the locale and NLS issues for pg_ctl still remain unfixed.

The only thing I have not done is to add the Russian part.  pg_ctl.c
should have everthing it needs, right?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: pg_ctl-related "fixes"

From
"Serguei A. Mokhov"
Date:
On Tue, 1 Jun 2004, Bruce Momjian wrote:

> Date: Tue, 1 Jun 2004 16:19:05 -0400 (EDT)
>
> > > The first commit just did the init_nls changes while the second was all
> > > pg_ctl.  Sorry.
> >
> > But the locale and NLS issues for pg_ctl still remain unfixed.
>
> The only thing I have not done is to add the Russian part.  pg_ctl.c
> should have everthing it needs, right?

It's missing these entirely:

***************
*** 798,803 ****
--- 799,810 ----
  int
  main(int argc, char **argv)
  {
+ #ifdef ENABLE_NLS
+     setlocale(LC_ALL, "");
+     bindtextdomain(progname, LOCALEDIR);
+     textdomain(progname);
+ #endif
+
      static struct option long_options[] = {
          {"help", no_argument, NULL, '?'},
          {"version", no_argument, NULL, 'V'},


http://archives.postgresql.org/pgsql-patches/2004-05/msg00499.php

Actually, as I look at the code now, the above additions should go after

        progname = get_progname(argv[0]);

Maybe I missed something while doing the diff to 1.1 and then it all
drifted under me.

--
Serguei A. Mokhov            |  /~\    The ASCII
Computer Science Department  |  \ / Ribbon Campaign
Concordia University         |   X    Against HTML
Montreal, Quebec, Canada     |  / \      Email!


Re: pg_ctl-related "fixes"

From
Bruce Momjian
Date:
Serguei A. Mokhov wrote:
> On Tue, 1 Jun 2004, Bruce Momjian wrote:
>
> > Date: Tue, 1 Jun 2004 16:19:05 -0400 (EDT)
> >
> > > > The first commit just did the init_nls changes while the second was all
> > > > pg_ctl.  Sorry.
> > >
> > > But the locale and NLS issues for pg_ctl still remain unfixed.
> >
> > The only thing I have not done is to add the Russian part.  pg_ctl.c
> > should have everthing it needs, right?
>
> It's missing these entirely:
>
> ***************
> *** 798,803 ****
> --- 799,810 ----
>   int
>   main(int argc, char **argv)
>   {
> + #ifdef ENABLE_NLS
> +     setlocale(LC_ALL, "");
> +     bindtextdomain(progname, LOCALEDIR);
> +     textdomain(progname);
> + #endif
> +
>       static struct option long_options[] = {
>           {"help", no_argument, NULL, '?'},
>           {"version", no_argument, NULL, 'V'},

Oops, I thought I added set_pglocale(argv[0], "pg_ctl") to pg_ctl.c, but
I think I just removed init_nls without touching pg_ctl.  Fixed now.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
? pg_ctl
Index: pg_ctl.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/bin/pg_ctl/pg_ctl.c,v
retrieving revision 1.4
diff -c -c -r1.4 pg_ctl.c
*** pg_ctl.c    1 Jun 2004 03:32:42 -0000    1.4
--- pg_ctl.c    1 Jun 2004 22:03:02 -0000
***************
*** 824,829 ****
--- 824,830 ----
  #endif

      progname = get_progname(argv[0]);
+     set_pglocale(argv[0], "pg_ctl");

      /*
       * save argv[0] so do_start() can look for the postmaster if