Re: plpgsql is not translate-aware - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: plpgsql is not translate-aware
Date
Msg-id 20080905163508.GG4353@alvh.no-ip.org
Whole thread Raw
In response to Re: plpgsql is not translate-aware  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: plpgsql is not translate-aware  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > In reviewing Volkan Yazici's (sorry for the dots) patch to improve
> > plpgsql's error messages, I noticed that we have no PO files for plpgsql
> > at all!
> 
> Ugh.  Yeah, we should fix that.  Does it actually just work, seeing
> that plpgsql is a loadable library?

Well, it didn't, but I just tested what I posted in the followup and it
does work:

alvherre=# create function aa (internal) returns int language plpgsql as $$ begin; select 1; end; $$;
ERROR:  las funciones plpgsql no pueden tener el tipo internal como argumento

The vices in the error message are not the translator's fault: missing
quotes and "plpgsql" instead of "PL/pgSQL":

alvherre=# set lc_messages to 'C';
SET
alvherre=# create function aa (internal) returns int language plpgsql as $$ begin; select 1; end; $$;
ERROR:  plpgsql functions cannot take type internal

I'd even go a bit further and say that the original should not include
the language name in the string, so that (say) plpython and plperl can
use the same translation:

"%s functions cannot take type \"%s\"", "PL/pgSQL", type_name

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: "Marko Kreen"
Date:
Subject: Re: Need more reviewers!
Next
From: Tom Lane
Date:
Subject: Re: plpgsql is not translate-aware