Re: Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding
Date
Msg-id 15569.1447128876@sss.pgh.pa.us
Whole thread Raw
In response to Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding  (Michael Paquier <michael.paquier@gmail.com>)
Responses =?gb18030?B?u9i4tKO6IFtCVUdTXSAgUmU6IFtCVUdTXSC72Li0?= =?gb18030?B?o7ogW0JVR1NdIEJVRyAjMTM3NjI6IHNlcnZlciB3?= =?gb18030?B?aWxsIGNyYXNoIGFmdGVyIHN1cGVydXNlciBhbHRl?= =?gb18030?B?ciBmdW5jdGlvbiBhbmQgc2V0IGNsaWVudF9lbmNv?= =?gb18030?B?ZGluZw==?=  ("笑见江湖" <funnyxj@qq.com>)
List pgsql-bugs
Michael Paquier <michael.paquier@gmail.com> writes:
> On Tue, Nov 10, 2015 at 9:51 AM, 笑见江湖 <funnyxj@qq.com> wrote:
>> Sorry, the correct statements which make server crash is:
>>
>> 1. alter function koi8r_to_utf8(integer, integer, cstring, internal,
>> integer) set work_mem = '4MB';
>> 2. set client_encoding = 'koi8';
>> 3. select 1;

> This indeed crashes, and that's not limited to this particular
> function, try for example iso8859_to_utf8 with ISO_8859_6 as
> client_encoding on even a different parameter for the same result.
> FWIW, here is a backtrace with assertions enabled:

Yeah... if you trace through this, you'll notice that (1) calling a
function having non-null proconfig requires fetching its pg_proc entry,
and (2) fetching anything from a catalog requires being inside a live
transaction, and (3) the client/server encoding translation functions have
to be invokable outside any transaction.  So as I said, this is not
going to work and we are not very interested in making it work.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding
Next
From: "笑见江湖"
Date:
Subject: =?gb18030?B?u9i4tKO6IFtCVUdTXSAgUmU6IFtCVUdTXSC72Li0?= =?gb18030?B?o7ogW0JVR1NdIEJVRyAjMTM3NjI6IHNlcnZlciB3?= =?gb18030?B?aWxsIGNyYXNoIGFmdGVyIHN1cGVydXNlciBhbHRl?= =?gb18030?B?ciBmdW5jdGlvbiBhbmQgc2V0IGNsaWVudF9lbmNv?= =?gb18030?B?ZGluZw==?=