Skip site navigation (1) Skip section navigation (2)

Re: translating exception messages of postgresql functions

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Julius Tuskenis <julius(at)nsoft(dot)lt>, pgsql-admin(at)postgresql(dot)org
Subject: Re: translating exception messages of postgresql functions
Date: 2008-05-14 16:41:37
Message-ID: 20080514164137.GC9838@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-admin
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

In response to

pgsql-admin by date

Next:From: bdorseyxi1Date: 2008-05-14 17:05:38
Subject: Windows OS Crash, got Data Folder, how do I get it running again...
Previous:From: Tom LaneDate: 2008-05-14 16:32:19
Subject: Re: translating exception messages of postgresql functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group