pgsql: Rationalize error messages within jsonfuncs.c.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Rationalize error messages within jsonfuncs.c.
Дата
Msg-id E1WzvdU-0007Jv-Ki@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Rationalize error messages within jsonfuncs.c.

I noticed that the functions in jsonfuncs.c sometimes printed error
messages that claimed I'd called some other function.  Investigation showed
that this was from repurposing code into "worker" functions without taking
much care as to whether it would mention the right SQL-level function if it
threw an error.  Moreover, there was a weird mismash of messages that
contained a fixed function name, messages that used %s for a function name,
and messages that constructed a function name out of spare parts, like
"json%s_populate_record" (which, quite aside from being ugly as sin, wasn't
even sufficient to cover all the cases).  This would put an undue burden on
our long-suffering translators.  Standardize on inserting the SQL function
name with %s so as to reduce the number of translatable strings, and pass
function names around as needed to make sure we can report the right one.
Fix up some gratuitous variations in wording, too.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/798e2357905f759913166d4f5be249e76a84c662

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c     |  187 ++++++++++++++++++++-------------
src/test/regress/expected/jsonb.out   |   22 ++--
src/test/regress/expected/jsonb_1.out |   22 ++--
3 files changed, 135 insertions(+), 96 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Rationalize error messages within jsonfuncs.c.
Следующее
От: Fujii Masao
Дата:
Сообщение: pgsql: Remove obsolete example of CSV log file name from log_filename d