Denis Afonin wrote:
> test=# CREATE DEFAULT CONVERSION test1 FOR 'LATIN1' TO 'KOI8' FROM
> CREATE CONVERSION
> test=# CREATE DEFAULT CONVERSION test2 FOR 'KOI8' TO 'LATIN1' FROM
> CREATE CONVERSION
> test=# set client_encoding to 'LATIN1';
> server closed the connection unexpectedly
> This probably means the server terminated abnormally
> before or while processing the request.
> Соединение с сервером было потеряно.
> Попытка переустановить: Безуспешно.
Hmm, this seems to be another variant of the recursive error issue fixed
Only this time the problem the error doesn't occur in translation, but
in encoding conversion. We could doo something similar to what we did
before with the translation, and try not to call conversion function in
case of a recursive error. However, sending an error message to the
client in wrong encoding is not as sane as sending it untranslated.
I think we should instead try to break the PANIC cycle. If we exceed
ERRORDATA_STACK_SIZE, and we're already PANICing, we should just die
immediately instead of throwing another PANIC about exceeding the stack
size. The attached patch does that.
However, a more serious issue is that a regular user can do that and
bring down the whole system. I suggest that we make "CREATE [DEFAULT]
CONVERSION" to call the conversion function with a empty string, to
check that it is in fact capable of doing the conversion. See 2nd
attached patch. This is a usability improvement too, as you
In response to
pgsql-hackers by date
|Next:||From: Heikki Linnakangas||Date: 2009-02-27 12:19:26|
|Subject: Re: Immediate shutdown and system(3)|
|Previous:||From: Peter Eisentraut||Date: 2009-02-27 11:32:34|
|Subject: Error codes for LIMIT and OFFSET|
pgsql-bugs by date
|Next:||From: Heikki Linnakangas||Date: 2009-02-27 15:10:45|
|Subject: Re: BUG #4679: invalid UTF-8 byte sequence detected near byte
0xa3 + postgresql|
|Previous:||From: aiwaniuk||Date: 2009-02-27 11:33:43|
|Subject: Re: BUG #4677: memory growth|