jian he <jian.universality@gmail.com> writes:
> While looking at it, in build_attrmap_by_position
> I guess errmsg may be better than errmsg_internal
> since there are around 10 related error messages in
> src/pl/plpgsql/src/expected/plpgsql_record.out,
> so it's user visible.
No, you misunderstand how that works:
errmsg_internal("%s", _(msg)),
The useful translation happens in the invocation of "_(msg)",
that is gettext(msg). Using errmsg_internal instead of
errmsg just indicates that there's no point in trying to
translate the string "%s". We do it like this rather than
simply writing
errmsg(msg),
because of the risk of sprintf doing something unexpected
with '%' characters in the translated message.
regards, tom lane