Re: Server broken down in covering GB18030 - Mailing list pgsql-bugs

From Qingqing Zhou
Subject Re: Server broken down in covering GB18030
Date
Msg-id dcq1nv$2h3r$1@news.hub.org
Whole thread Raw
In response to Server broken down in covering GB18030  (杨邕 <yayooo@gmail.com>)
Responses Re: Server broken down in covering GB18030  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-bugs
My theory is "select;" incurs a parse error and this error message is
supposed to be translated into your encoding, but unfortunately not every
UTF8 character is necessarily be encoded as GB18030, which will cause an
infinite recursive elogs just like this:

1:elog(parse_error)        // contain unencodable characters
2:    elog(report_not_translatable)    // contain unencodable characters
again
3:        elog(report_report_not_translatable)
4:            elog(report_report_report_not_translatable)
5:                ...

and corrupt the elog stack.

To fix this, we could just print a "Unsupport encoding" message which is
just a plain ascii character string and stop the recursion at step 3.

Regards,
Qingqing

"Ñîçß" <yayooo@gmail.com> writes
> template1=# select version();
> PostgreSQL 8.0.3 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
> 3.4.2 (mingw-special)
> template1=# create database test1 encoding 'unicode';
> test1=# \encoding
> UNICODE
> test1=# \encoding gb18030
> test1=# \encoding
> GB18030
> test1=# select;
...
> ±ÈÖÂÃü´íÎó»¹¹ý·ÖµÄ´íÎó:  ERRORDATA_STACK_SIZE exceeded

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #1807: cannot build postgresql: libascii_and_mic.so.0.0: No such file or directory
Next
From: "DKnoto"
Date:
Subject: BUG #1803: Incomplete table list in psql