pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: 笑见江湖 <funnyxj@qq.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: 回复: [BUGS]  Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding
Date: Tue, 10 Nov 2015 14:05:10 +0800
Message-ID: <tencent_59E660A73F7D2FEF617F9C72@qq.com> (raw)
In-Reply-To: <15569.1447128876@sss.pgh.pa.us>
References: <20151109104125.2569.45365@wrigleys.postgresql.org>
	<22805.1447080354@sss.pgh.pa.us>
	<tencent_5C106B6934A0F0A048A28456@qq.com>
	<CAB7nPqQrCrPK363Ls+qmhsXkxhzJ6Xrsf+qD4qKgR+aBG75TjA@mail.gmail.com>
	<15569.1447128876@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

If we use elog ERROR or FATAL instead of Assert, we can avoid this crash, so I think it is better than crash.
Besides, are there other functions can run outside transaction except encoding functions?


------------------ 原始邮件 ------------------
发件人: "Tom Lane";<tgl@sss.pgh.pa.us>;
发送时间: 2015年11月10日(星期二) 中午12:14
收件人: "Michael Paquier"<michael.paquier@gmail.com>; 
抄送: "笑见江湖"<funnyxj@qq.com>; "pgsql-bugs@postgresql.org"<pgsql-bugs@postgresql.org>; 
主题: Re: [BUGS]  Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding



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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Message-ID: <tencent_59E660A73F7D2FEF617F9C72@qq.com>
Permalink:  ../tencent_59E660A73F7D2FEF617F9C72@qq.com/
Also on:    postgresql.org/message-id/tencent_59E660A73F7D2FEF617F9C72@qq.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: funnyxj@qq.com, tgl@sss.pgh.pa.us, michael.paquier@gmail.com
  Subject: Re: 回复: [BUGS]  Re: [BUGS] 回复: [BUGS] BUG #13762: server will crash after superuser alter function and set client_encoding
  In-Reply-To: <tencent_59E660A73F7D2FEF617F9C72@qq.com>
  References: <20151109104125.2569.45365@wrigleys.postgresql.org> <22805.1447080354@sss.pgh.pa.us> <tencent_5C106B6934A0F0A048A28456@qq.com> <CAB7nPqQrCrPK363Ls+qmhsXkxhzJ6Xrsf+qD4qKgR+aBG75TjA@mail.gmail.com> <15569.1447128876@sss.pgh.pa.us> <tencent_59E660A73F7D2FEF617F9C72@qq.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox