Thread: [HACKERS] locale problem of bgworker: logical replication launcher and workerprocess

Hi,
I tried ver. 10 beta3.
I had below messages.

-----
$ pg_ctl start
서버를 시작하기 위해 기다리는 중....완료
서버 시작됨
2017-08-22 14:06:21.248 KST [32765] 로그:  IPv6, 주소: "::1", 포트 5433 번으로 접속을 허용합니다
2017-08-22 14:06:21.248 KST [32765] 로그:  IPv4, 주소: "127.0.0.1", 포트 5433 번으로 접속을 허용합니다
2017-08-22 14:06:21.364 KST [32765] 로그:  "/tmp/.s.PGSQL.5433" 유닉스 도메인 소켓으로 접속을 허용합니다
2017-08-22 14:06:21.570 KST [32766] 로그:  데이터베이스 시스템 마지막 가동 중지 시각: 2017-08-22 14:04:52 KST
2017-08-22 14:06:21.570 KST [32766] 로그:  recovered replication state of node 1 to 0/0
2017-08-22 14:06:21.638 KST [32765] 로그:  이제 데이터베이스 서버로 접속할 수 있습니다
2017-08-22 14:06:21.697 KST [306] 로그:  logical replication apply worker for subscription "replica_a" has started
2017-08-22 14:06:21.698 KST [306] 오류:  발행 서버에 연결 할 수 없음: ??? ??? ? ??: ??? ???
        "localhost" (::1) ???? ??? ?? ???,
        5432 ??? TCP/IP ??? ???? ??????.
    ??? ??? ? ??: ??? ???
        "localhost" (127.0.0.1) ???? ??? ?? ???,
        5432 ??? TCP/IP ??? ???? ??????.
-----

main postmaster messages are printed  in korean well,
but bgworker process message is not.

This problem seems to have occurred because the server locale environment and the client's that are different.

How I can resolv that?

Regards ioseph.

On 8/22/17 01:19, Ioseph Kim wrote:
> 2017-08-22 14:06:21.697 KST [306] 로그:  logical replication apply
> worker for subscription "replica_a" has started
> 2017-08-22 14:06:21.698 KST [306] 오류:  발행 서버에 연결 할 수 없음:
> ??? ??? ? ??: ??? ???
>         "localhost" (::1) ???? ??? ?? ???,
>         5432 ??? TCP/IP ??? ???? ??????.
>     ??? ??? ? ??: ??? ???
>         "localhost" (127.0.0.1) ???? ??? ?? ???,
>         5432 ??? TCP/IP ??? ???? ??????.
> -----
> 
> main postmaster messages are printed  in korean well,
> but bgworker process message is not.
> 
> This problem seems to have occurred because the server locale
> environment and the client's that are different.

I have tried it locally with a ko_KR locale, and it seems to work
correctly for me.  Still, I can imagine there are all kinds of ways this
could go wrong in particular configurations.  Could you construct a
reproducible test setup, including specific initdb and locale settings,
operating system, etc.?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Thanks for reply.

I resolved this problem.

This problem is that dgettext() function use codeset of database's lc_ctype.

below database's lc_ctype is C, but locale is ko_KR.UTF8.

I made a new database with lc_ctype is ko_KR.UTF8.

this problem is resolved.

----

work logs are here.


(10) postgres@postgres=# \l                               데이터베이스 목록   이름    |  소유주  | 인코딩 | Collate |    Ctype    |
액세스 권한
 
-----------+----------+--------+---------+-------------+----------------------- krdb      | postgres | UTF8   | C
|ko_KR.UTF-8 | postgres  | postgres | UTF8   | C       | C           | template0 | postgres | UTF8   | C       | C
    | 
 
=c/postgres          +           |          |        |         |             | 
postgres=CTc/postgres template1 | postgres | UTF8   | C       | C           | 
=c/postgres          +           |          |        |         |             | 
postgres=CTc/postgres
(4개 행)

(10) postgres@postgres=# \c
접속정보: 데이터베이스="postgres", 사용자="postgres".
(10) postgres@postgres=# create subscription sub1 connection 
'host=127.0.0.1 port=5432 client_encoding=C' publication pub1;
2017-08-25 18:13:34.556 KST [5401] 오류:  발행 서버에 연결 할 수 없음: ??? 
??? ? ??: ??? ???        "127.0.0.1" ???? ??? ?? ???,        5432 ??? TCP/IP ??? ???? ??????.
2017-08-25 18:13:34.556 KST [5401] 명령 구문:  create subscription sub1 
connection 'host=127.0.0.1 port=5432 client_encoding=C' publication pub1;
오류:  발행 서버에 연결 할 수 없음: ??? ??? ? ??: ??? ???    "127.0.0.1" ???? ??? ?? ???,    5432 ??? TCP/IP ??? ???? ??????.
(10) postgres@postgres=# \c krdb
접속정보: 데이터베이스="krdb", 사용자="postgres".
(10) postgres@krdb=# create subscription sub1 connection 'host=127.0.0.1 
port=5432 client_encoding=C' publication pub1;
2017-08-25 18:13:45.687 KST [5402] 오류:  발행 서버에 연결 할 수 없음: 
서버에 연결할 수 없음: 연결이 거부됨        "127.0.0.1" 호스트에 서버가 가동 중인지,        5432 포트로 TCP/IP 연결이 가능한지 살펴보십시오.
2017-08-25 18:13:45.687 KST [5402] 명령 구문:  create subscription sub1 
connection 'host=127.0.0.1 port=5432 client_encoding=C' publication pub1;
오류:  발행 서버에 연결 할 수 없음: 서버에 연결할 수 없음: 연결이 거부됨    "127.0.0.1" 호스트에 서버가 가동 중인지,    5432 포트로 TCP/IP 연결이 가능한지 살펴보십시오.


2017년 08월 23일 22:40에 Peter Eisentraut 이(가) 쓴 글:
> On 8/22/17 01:19, Ioseph Kim wrote:
>> 2017-08-22 14:06:21.697 KST [306] 로그:  logical replication apply
>> worker for subscription "replica_a" has started
>> 2017-08-22 14:06:21.698 KST [306] 오류:  발행 서버에 연결 할 수 없음:
>> ??? ??? ? ??: ??? ???
>>          "localhost" (::1) ???? ??? ?? ???,
>>          5432 ??? TCP/IP ??? ???? ??????.
>>      ??? ??? ? ??: ??? ???
>>          "localhost" (127.0.0.1) ???? ??? ?? ???,
>>          5432 ??? TCP/IP ??? ???? ??????.
>> -----
>>
>> main postmaster messages are printed  in korean well,
>> but bgworker process message is not.
>>
>> This problem seems to have occurred because the server locale
>> environment and the client's that are different.
> I have tried it locally with a ko_KR locale, and it seems to work
> correctly for me.  Still, I can imagine there are all kinds of ways this
> could go wrong in particular configurations.  Could you construct a
> reproducible test setup, including specific initdb and locale settings,
> operating system, etc.?
>




On 8/25/17 05:14, Ioseph Kim wrote:
> I resolved this problem.
> 
> This problem is that dgettext() function use codeset of database's lc_ctype.
> 
> below database's lc_ctype is C, but locale is ko_KR.UTF8.

Thank you for following up.  As you have discovered, that combination of
locale settings doesn't work well.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services