From: Michal Leinweber <lei@aswsyst.cz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #13638: Exception texts from plperl has bad encoding
Date: Fri, 25 Sep 2015 22:15:34 +0200
Message-ID: <d7e348cdf513e534e0a1a08d55d77d77@leisoft.cz> (raw)
In-Reply-To: <18478.1443209624@sss.pgh.pa.us>
References: <20150925112345.26913.28407@wrigleys.postgresql.org>
<18105.1443208708@sss.pgh.pa.us>
<18478.1443209624@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The problem is not only with elog call, but it also fires if plpgsql
code called from plperl function raises exception.
Best Regards,
Michal Leinweber
On 2015-09-25 21:33, Tom Lane wrote:
> I wrote:
>> I suspect the root problem is that instead of baldly doing
>> croak("%s", edata->message);
>> in do_util_elog(), we need to do something to inform Perl what
>> encoding
>> the message string is in. This is beyond my Perl-fu, however.
>
> BTW, if the answer to that involves turning the message back into an
> SV,
> I think we should not do that but just use the SV that was passed in
> originally. Then the TRY/CATCH could go away entirely, ie the code
> would become roughly like
>
> if (level < ERROR)
> {
> cmsg = sv2cstr(msg);
> elog(level, "%s", cmsg);
> pfree(cmsg);
> }
> else
> {
> croak-with-SV(msg);
> }
>
> which knows slightly more about the meaning of "level" than before,
> but otherwise seems much less entangled with anything.
>
> It's still beyond my Perl-fu ...
>
> 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
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: lei@aswsyst.cz, tgl@sss.pgh.pa.us
Subject: Re: BUG #13638: Exception texts from plperl has bad encoding
In-Reply-To: <d7e348cdf513e534e0a1a08d55d77d77@leisoft.cz>
References: <20150925112345.26913.28407@wrigleys.postgresql.org> <18105.1443208708@sss.pgh.pa.us> <18478.1443209624@sss.pgh.pa.us> <d7e348cdf513e534e0a1a08d55d77d77@leisoft.cz>
* 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