Thread: BUG #5818: initdb lose the single quote of locale

BUG #5818: initdb lose the single quote of locale

From
"yulei"
Date:
The following bug has been logged online:

Bug reference:      5818
Logged by:          yulei
Email address:      yu1ei@hotmail.com
PostgreSQL version: 9.0.2
Operating system:   Windows XP Service Pack 3
Description:        initdb lose the single quote of locale
Details:

Hi,dear developers!
I am using a chinses window xp os.
i run "initdb -E UTF-8 -D temp" in cmd,it can get the
locale:"Chinese_People's Republic of China.936"。

but when initdb  creating template1 , it lose the single quote of locale,it
use "Chinese_Peoples Republic of China.936"(notice that , it lose the '
after "Chinese_People" ) for the "template1" record's
“datcollate”,“datctype” Column in tablepg_database。

though "creating template1 database" is ok,but the initdb's next step
"initializing pg_authid ..." failed.
bucause the invalid locale "Chinese_People's Republic of China.936" is used
to run the command "REVOKE ALL on pg_authid FROM public;"。

and the cmd resule is :
creating template1 database in temp/base/1 ... ok
initializing pg_authid ... :  ݿʹõԻͲϵͳIJ
ϸϢ:  ݿ⼯Ⱥ LC_COLLATE "Chinese_Peoples Re
ʾ:  һԻ´ݿ⣬߰װʧԻ.
child process exited with exit code 1
initdb: removing data directory "temp"。

to support what i say , i test like:
add "
create pg_database_test 5158 ( datname = name )
open pg_database_test
insert OID = 1 ( "Chinese_People's Republic of China.936")
close pg_database_test
"
 to postgreSQLHOME/share/postgres.bki

run cmd "initdb -E UTF-8 -D temp --local=chs"

it can init successful,then i start the server,run sql:
"SELECT * from pg_database_test" ,the result show "Chinese_Peoples Republic
of China.936".
yes ,the single quote of test string "Chinese_People's Republic of
China.936" lose.

can you fix it ?

Re: BUG #5818: initdb lose the single quote of locale

From
Robert Haas
Date:
On Fri, Jan 7, 2011 at 1:42 AM, yulei <yu1ei@hotmail.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =C2=A0 =C2=A0 =C2=A05818
> Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0yulei
> Email address: =C2=A0 =C2=A0 =C2=A0yu1ei@hotmail.com
> PostgreSQL version: 9.0.2
> Operating system: =C2=A0 Windows XP Service Pack 3
> Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0initdb lose the single quote of l=
ocale
> Details:
>
> Hi,dear developers!
> I am using a chinses window xp os.
> i run "initdb -E UTF-8 -D temp" in cmd,it can get the
> locale:"Chinese_People's Republic of China.936"=E3=80=82
>
> but when initdb =C2=A0creating template1 , it lose the single quote of lo=
cale,it
> use "Chinese_Peoples Republic of China.936"(notice that , it lose the '
> after "Chinese_People" ) for the "template1" record's
> =E2=80=9Cdatcollate=E2=80=9D,=E2=80=9Cdatctype=E2=80=9D Column in tablepg=
_database=E3=80=82
>
> though "creating template1 database" is ok,but the initdb's next step
> "initializing pg_authid ..." failed.
> bucause the invalid locale "Chinese_People's Republic of China.936" is us=
ed
> to run the command "REVOKE ALL on pg_authid FROM public;"=E3=80=82
>
> and the cmd resule is :
> creating template1 database in temp/base/1 ... ok
> initializing pg_authid ... : =C2=A0=DD=BF=CA=B9=C3=B5=D4=BB=CD=B2=CF=B5=
=CD=B3=C4=B2
> =CF=B8=CF=A2: =C2=A0=DD=BF=E2=BC=AF=C8=BA LC_COLLATE "Chinese_Peoples Re
> =CA=BE: =C2=A0=D2=BB=D4=BB=C2=B4=DD=BF=E2=A3=AC=DF=B0=D7=B0=CA=A7=D4=BB.
> child process exited with exit code 1
> initdb: removing data directory "temp"=E3=80=82
>
> to support what i say , i test like:
> add "
> create pg_database_test 5158 ( datname =3D name )
> open pg_database_test
> insert OID =3D 1 ( "Chinese_People's Republic of China.936")
> close pg_database_test
> "
> =C2=A0to postgreSQLHOME/share/postgres.bki
>
> run cmd "initdb -E UTF-8 -D temp --local=3Dchs"
>
> it can init successful,then i start the server,run sql:
> "SELECT * from pg_database_test" ,the result show "Chinese_Peoples Republ=
ic
> of China.936".
> yes ,the single quote of test string "Chinese_People's Republic of
> China.936" lose.
>
> can you fix it ?

I don't see any responses to this bug.  Do we have a quoting problem somewh=
ere?

--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: BUG #5818: initdb lose the single quote of locale

From
Heikki Linnakangas
Date:
On 07.01.2011 08:42, yulei wrote:
>
> The following bug has been logged online:
>
> Bug reference:      5818
> Logged by:          yulei
> Email address:      yu1ei@hotmail.com
> PostgreSQL version: 9.0.2
> Operating system:   Windows XP Service Pack 3
> Description:        initdb lose the single quote of locale
> Details:
>
> Hi,dear developers!
> I am using a chinses window xp os.
> i run "initdb -E UTF-8 -D temp" in cmd,it can get the
> locale:"Chinese_People's Republic of China.936"。
>
> but when initdb  creating template1 , it lose the single quote of locale,it
> use "Chinese_Peoples Republic of China.936"(notice that , it lose the '
> after "Chinese_People" ) for the "template1" record's
> “datcollate”,“datctype” Column in tablepg_database。

Fixed. Thanks for the report, and sorry for the delay. The fix will
appear in the next minor version.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com