Teodor Sigaev <teodor@sigaev.ru> writes:
> Does anybody have an objections to patch?
1) Does this really pass muster from the translatability standpoint?
I doubt it. I'd expect the translation of "cannot cast jsonb string
to int4" to use a translated equivalent of "string", but this code will
not do that. You can't really fix it by gettext'ing the result of
JsonbTypeName, either, because then you're breaking the rule about not
assembling translated strings from components.
2) Our usual convention for type names that are written in error messages
is to use the SQL-standard names, that is "integer" and "double precision"
and so on. For instance, float8in and int4in do not use the internal type
names in their messages:
regression=# select 'bogus'::float8;
ERROR: invalid input syntax for type double precision: "bogus"
LINE 1: select 'bogus'::float8;
^
regression=# select 'bogus'::int4;
ERROR: invalid input syntax for integer: "bogus"
LINE 1: select 'bogus'::int4;
^
So I think you made the wrong choices in jsonb_int4 etc.
regards, tom lane