Re: Add column name to error description

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Add column name to error description
Дата
Msg-id 1037878.1741367955@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Add column name to error description  (jian he <jian.universality@gmail.com>)
Список pgsql-hackers
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



В списке pgsql-hackers по дате отправления: