Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zvnhs-0000AZ-HB for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Nov 2015 14:46:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zvnhr-0003nb-UC for pgsql-bugs@arkaria.postgresql.org; Mon, 09 Nov 2015 14:46:03 +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 1Zvnhr-0003nU-H0 for pgsql-bugs@postgresql.org; Mon, 09 Nov 2015 14:46:03 +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 1Zvnhn-0005U8-3B for pgsql-bugs@postgresql.org; Mon, 09 Nov 2015 14:46:03 +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 tA9EjsE7022806; Mon, 9 Nov 2015 09:45:56 -0500 From: Tom Lane To: funnyxj@qq.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13762: server will crash after superuser alter function and set client_encoding In-reply-to: <20151109104125.2569.45365@wrigleys.postgresql.org> References: <20151109104125.2569.45365@wrigleys.postgresql.org> Comments: In-reply-to funnyxj@qq.com message dated "Mon, 09 Nov 2015 10:41:25 +0000" Date: Mon, 09 Nov 2015 09:45:54 -0500 Message-ID: <22805.1447080354@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 funnyxj@qq.com writes: > When superuser execute the following statements, the server will crash, it > may be a bug. > 1. alter function koi8r_to_utf8(integer, integer, cstring, internal, > integer) set work_mem = default ; That would be in the category of "don't do that". Encoding conversion functions are invoked using special code paths that don't support every possible option for functions, so I'm not too surprised that this breaks things (and I see no reason to expend effort to try to make it not be broken). FWIW, I can't reproduce a crash with the described case either, so I think there's probably some additional condition required. But it doesn't really matter. Mucking with the properties of built-in functions isn't considered a supported thing to do. 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