Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id D62922E00E0 for ; Wed, 14 May 2008 12:29:22 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 33183-02-6 for ; Wed, 14 May 2008 12:29:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from vilnius.balt.net (vilnius.balt.net [195.14.170.14]) by developer.postgresql.org (Postfix) with ESMTP id A1C932E00C7 for ; Wed, 14 May 2008 12:22:26 -0300 (ADT) Received: from nSoft.lt (unknown [217.117.29.29]) by vilnius.balt.net (Postfix) with ESMTP id 99BD838E971; Wed, 14 May 2008 18:22:24 +0300 (EEST) Received: from [192.168.16.191] (unknown [192.168.16.191]) by nSoft.lt (Postfix) with ESMTP id DD5E3BF2FE; Wed, 14 May 2008 19:03:36 +0000 (GMT) Message-ID: <482B03B0.8060206@nsoft.lt> Date: Wed, 14 May 2008 18:22:24 +0300 From: Julius Tuskenis User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Alvaro Herrera CC: pgsql-admin@postgresql.org Subject: Re: translating exception messages of postgresql functions References: <482AF7F7.5090309@nsoft.lt> <20080514144627.GD5521@alvh.no-ip.org> In-Reply-To: <20080514144627.GD5521@alvh.no-ip.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.192 tagged_above=0 required=5 tests=AWL=0.192 X-Spam-Level: X-Archive-Number: 200805/119 X-Sequence-Number: 29203 Alvaro Herrera rašė: > Julius Tuskenis wrote: > >> Hello, >> >> I'd like to ask how is translation of raised exceptions done in >> postgresql applications? >> > > You want it translated or not translated? > I want to translate the exception message. For example I raise an exception in pg function like RAISE EXCEPTION 'my exception', then in my application that calls the function I catch the exception. But before I show it to the user of application I have to translate it. How do I know what exception it is? As Tom Lane answered - the only way is to rely on message text. -- Julius Tuskenis Programavimo skyriaus vadovas UAB nSoft mob. +37068233050