Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 81B222E003A for ; Wed, 14 May 2008 13:41:54 -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 93547-08 for ; Wed, 14 May 2008 13:41:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by developer.postgresql.org (Postfix) with ESMTP id 22EDA2E002D for ; Wed, 14 May 2008 13:41:47 -0300 (ADT) Received: from perhan.alvh.no-ip.org (200-126-123-196.bk8-dsl.surnet.cl [200.126.123.196]) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m4EGgeKs023574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 May 2008 09:42:42 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 28DA147C5C; Wed, 14 May 2008 12:41:37 -0400 (CLT) Date: Wed, 14 May 2008 12:41:37 -0400 From: Alvaro Herrera To: Tom Lane Cc: Julius Tuskenis , pgsql-admin@postgresql.org Subject: Re: translating exception messages of postgresql functions Message-ID: <20080514164137.GC9838@alvh.no-ip.org> References: <482AF7F7.5090309@nsoft.lt> <20080514144627.GD5521@alvh.no-ip.org> <482B03B0.8060206@nsoft.lt> <20080514153337.GI5521@alvh.no-ip.org> <482B09DE.1040601@nsoft.lt> <20999.1210782739@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20999.1210782739@sss.pgh.pa.us> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Wed, 14 May 2008 09:42:43 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/123 X-Sequence-Number: 29207 Tom Lane wrote: > I wonder if it would help to make plpgsql pass the RAISE format string > through gettext? Hmm, nice idea. However, > This would only be a usable approach if there were some fairly easy way > to add installation-specific translations to gettext's table. I don't > know enough about gettext to know if that's doable. There are lots of caveats -- the first being that you would need to extract the messages from the function body. I don't think there's a gettext PL/pgSQL parser, so there's a first hurdle there. Then there's the matter of not mixing the "postgres" message domain with the user's, so we would need to change it just before calling RAISE and restore it afterwards. -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support