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

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 (view raw, whole thread or download thread mbox)
Thread:
Lists: pgsql-committerspgsql-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

pgsql-hackers by date

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

pgsql-committers by date

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

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