Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zfb8W-0007LY-Vg for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Sep 2015 22:06:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zfb8W-0006RF-BT for pgsql-bugs@arkaria.postgresql.org; Fri, 25 Sep 2015 22:06:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZfZPH-0001dA-Lu for pgsql-bugs@postgresql.org; Fri, 25 Sep 2015 20:15:47 +0000 Received: from indigo.leisoft.cz ([194.213.194.162]) by makus.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZfZPA-0007TQ-K6 for pgsql-bugs@postgresql.org; Fri, 25 Sep 2015 20:15:46 +0000 Received: (qmail 21809 invoked from network); 25 Sep 2015 22:15:37 +0200 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on indigo-user.leisoft.cz X-Spam-Level: * X-Spam-Status: No, score=1.6 required=4.0 tests=BAYES_50,RDNS_NONE autolearn=no version=3.3.2 Received: from unknown (HELO leisoft.cz) (192.168.254.4) by 192.168.254.3 with SMTP; 25 Sep 2015 22:15:35 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 25 Sep 2015 22:15:34 +0200 From: Michal Leinweber To: Tom Lane Cc: pgsql-bugs@postgresql.org Subject: Re: BUG #13638: Exception texts from plperl has bad encoding 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> Message-ID: X-Sender: lei@aswsyst.cz User-Agent: Roundcube Webmail/1.1.3 X-Pg-Spam-Score: -1.9 (-) 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 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