pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Improve internationalization of messages involving type names
7+ messages / 4 participants
[nested] [flat]
* pgsql: Improve internationalization of messages involving type names
@ 2016-03-28 17:25 Alvaro Herrera <alvherre@alvh.no-ip.org>
0 siblings, 2 replies; 7+ messages in thread
From: Alvaro Herrera @ 2016-03-28 17:25 UTC (permalink / raw)
To: pgsql-committers
Improve internationalization of messages involving type names
Change the slightly different variations of the message
function FOO must return type BAR
to a single wording, removing the variability in type name so that they
all create a single translation entry; since the type name is not to be
translated, there's no point in it being part of the message anyway.
Also, change them all to use the same quoting convention, namely that
the function name is not to be quoted but the type name is. (I'm not
quite sure why this is so, but it's the clear majority.)
Some similar messages such as "encoding conversion function FOO must ..."
are also changed.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/59a2111b23f6ceec4c777d68e20c1027d3c57c6f
Modified Files
--------------
src/backend/commands/conversioncmds.c | 4 ++--
src/backend/commands/event_trigger.c | 4 ++--
src/backend/commands/foreigncmds.c | 4 ++--
src/backend/commands/operatorcmds.c | 8 ++++----
src/backend/commands/proclang.c | 8 ++++----
src/backend/commands/trigger.c | 4 ++--
src/backend/commands/typecmds.c | 37 ++++++++++++++++++-----------------
src/backend/parser/parse_clause.c | 4 ++--
8 files changed, 37 insertions(+), 36 deletions(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Improve internationalization of messages involving type names
@ 2016-03-28 17:35 Stephen Frost <sfrost@snowman.net>
parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
1 sibling, 0 replies; 7+ messages in thread
From: Stephen Frost @ 2016-03-28 17:35 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-committers
Alvaro,
* Alvaro Herrera (alvherre@alvh.no-ip.org) wrote:
> Improve internationalization of messages involving type names
>
> Change the slightly different variations of the message
> function FOO must return type BAR
> to a single wording, removing the variability in type name so that they
> all create a single translation entry; since the type name is not to be
> translated, there's no point in it being part of the message anyway.
>
> Also, change them all to use the same quoting convention, namely that
> the function name is not to be quoted but the type name is. (I'm not
> quite sure why this is so, but it's the clear majority.)
>
> Some similar messages such as "encoding conversion function FOO must ..."
> are also changed.
Buildfarm is pretty upset with this one, in particular:
http://git.postgresql.org/gitweb/?p=postgresql.git;a=blobdiff;f=src/backend/commands/event_trigger.c...
Thanks!
Stephen
Attachments:
[application/pgp-signature] signature.asc (818B, ../../20160328173558.GU3127@tamriel.snowman.net/2-signature.asc)
download
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Improve internationalization of messages involving type names
@ 2016-03-28 18:06 Tom Lane <tgl@sss.pgh.pa.us>
parent: Alvaro Herrera <alvherre@alvh.no-ip.org>
1 sibling, 1 reply; 7+ messages in thread
From: Tom Lane @ 2016-03-28 18:06 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@alvh.no-ip.org>; +Cc: pgsql-committers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Also, change them all to use the same quoting convention, namely that
> the function name is not to be quoted but the type name is. (I'm not
> quite sure why this is so, but it's the clear majority.)
Actually, I think the general convention is to NOT quote type names
in error messages. Certainly that's so when using format_type_be()
to produce a name for a not-known-at-compile-time type. I would
argue that these messages should be written to look the same as if
format_type_be() had been used, and that would mean leaving off
the quotes.
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Improve internationalization of messages involving type names
@ 2016-03-30 21:43 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 7+ messages in thread
From: Alvaro Herrera @ 2016-03-30 21:43 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers
Tom Lane wrote:
> Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> > Also, change them all to use the same quoting convention, namely that
> > the function name is not to be quoted but the type name is. (I'm not
> > quite sure why this is so, but it's the clear majority.)
>
> Actually, I think the general convention is to NOT quote type names
> in error messages. Certainly that's so when using format_type_be()
> to produce a name for a not-known-at-compile-time type. I would
> argue that these messages should be written to look the same as if
> format_type_be() had been used, and that would mean leaving off
> the quotes.
Ok, I'll change it.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Improve internationalization of messages involving type names
@ 2016-04-01 16:37 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 7+ messages in thread
From: Alvaro Herrera @ 2016-04-01 16:37 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers
Alvaro Herrera wrote:
> Tom Lane wrote:
> > Actually, I think the general convention is to NOT quote type names
> > in error messages. Certainly that's so when using format_type_be()
> > to produce a name for a not-known-at-compile-time type. I would
> > argue that these messages should be written to look the same as if
> > format_type_be() had been used, and that would mean leaving off
> > the quotes.
>
> Ok, I'll change it.
Done.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: pgsql: Improve internationalization of messages involving type names
@ 2016-04-01 16:43 Tom Lane <tgl@sss.pgh.pa.us>
parent: Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 7+ messages in thread
From: Tom Lane @ 2016-04-01 16:43 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-committers
Alvaro Herrera <alvherre@2ndquadrant.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.
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [COMMITTERS] pgsql: Improve internationalization of messages involving type names
@ 2016-04-01 17:06 Alvaro Herrera <alvherre@2ndquadrant.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Alvaro Herrera @ 2016-04-01 17:06 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-hackers@postgresql.org
Moving to -hackers.
Tom Lane wrote:
> Alvaro Herrera <alvherre@2ndquadrant.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
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2016-04-01 17:06 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-03-28 17:25 pgsql: Improve internationalization of messages involving type names Alvaro Herrera <alvherre@alvh.no-ip.org>
2016-03-28 17:35 ` Stephen Frost <sfrost@snowman.net>
2016-03-28 18:06 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-03-30 21:43 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-04-01 16:37 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2016-04-01 16:43 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-04-01 17:06 ` Alvaro Herrera <alvherre@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox