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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: 笑见江湖 <funnyxj(at)qq(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding
Date: 2015-11-10 04:14:36
Message-ID: 15569.1447128876@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> On Tue, Nov 10, 2015 at 9:51 AM, <funnyxj(at)qq(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message 笑见江湖 2015-11-10 06:05:10 回复: [BUGS] Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding
Previous Message rucsoftsec 2015-11-10 03:07:30 BUG #13764: function ghstore_consistent() returns a wrong value if var "strategy" contains an unsupported number