Re: [COMMITTERS] pgsql: Improve internationalization of messages involving type names

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Improve internationalization of messages involving type names
Date: 2016-04-01 17:06:42
Message-ID: 20160401170642.GA57509@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Moving to -hackers.

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> > Alvaro Herrera wrote:
> >> Tom Lane wrote:
> >>> Actually, I think the general convention is to NOT quote type names
> >>> in error messages.
>
> >> Ok, I'll change it.
>
> > Done.
>
> Thanks. Should we make a push to get rid of hard-wired type names in
> other messages? There's still quite a few "invalid input syntax for ..."
> instances that could be whacked until they all share the same translatable
> message.

Ah, I hadn't noticed those precisely because they lack the quotes ... I
grepped for 'type \"%' and found a few matches but didn't seem
interesting enough since there's only one of each, such as
errmsg("constant of the type \"regrole\" cannot be used here")

The 'invalid input syntax' are much more numerous. Also the "value XYZ
is out of range" messages. Both of those seem definitely worth fixing.
I also saw "value too long" for char/varchar but they're only two
distinct messages and fixing those would require printing the maxlen in
place before raising the message -- probably not worth the trouble.

I also found these while paging through grep results,

src/backend/utils/adt/json.c: errmsg("could not determine data type for argument 1")));
src/backend/utils/adt/json.c: errmsg("could not determine data type for argument 2")));
src/backend/utils/adt/json.c: errmsg("could not determine data type for argument %d",

which seem worth merging too.

If nobody opposes, I will fix those after feature freeze.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Teodor Sigaev 2016-04-01 17:11:57 pgsql: Fixes in bloom contrib module missed during review
Previous Message Tom Lane 2016-04-01 16:43:50 Re: pgsql: Improve internationalization of messages involving type names

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2016-04-01 17:08:33 Re: [PATCH] Phrase search ported to 9.6
Previous Message David G. Johnston 2016-04-01 16:57:31 Re: syntax sugar for conditional check