Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zw0KV-0006PA-V9 for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Nov 2015 04:14:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zw0KV-0003Ci-EA for pgsql-bugs@arkaria.postgresql.org; Tue, 10 Nov 2015 04:14:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zw0KT-0003CP-SJ for pgsql-bugs@postgresql.org; Tue, 10 Nov 2015 04:14:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1Zw0KP-0005hI-9B for pgsql-bugs@postgresql.org; Tue, 10 Nov 2015 04:14:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tAA4EaQZ015570; Mon, 9 Nov 2015 23:14:36 -0500 From: Tom Lane To: Michael Paquier cc: =?UTF-8?B?56yR6KeB5rGf5rmW?= , "pgsql-bugs@postgresql.org" Subject: Re: =?UTF-8?Q?Re=3A_=5BBUGS=5D_=E5=9B=9E=E5=A4=8D=EF=BC=9A_=5BBUGS=5D_BUG_=2313762=3A_server_will_?= =?UTF-8?Q?crash_after_superuser_alter_function_and_set_client=5Fencoding?= In-reply-to: References: <20151109104125.2569.45365@wrigleys.postgresql.org> <22805.1447080354@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Tue, 10 Nov 2015 10:08:35 +0900" Date: Mon, 09 Nov 2015 23:14:36 -0500 Message-ID: <15569.1447128876@sss.pgh.pa.us> X-Pg-Spam-Score: -2.2 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Michael Paquier writes: > On Tue, Nov 10, 2015 at 9:51 AM, 笑见江湖 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs