Remove an unnecessary errmsg_plural in dependency.c

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Remove an unnecessary errmsg_plural in dependency.c
Дата
Msg-id CALj2ACUfJKTmK5v=vF+H2iLkqM9Yvjsp6iXaCqAks6gDpzZh6g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Remove an unnecessary errmsg_plural in dependency.c
Список pgsql-hackers
Hi,

It looks like the following errmsg_plural in dependency.c is
unnecessary as numReportedClient > 1 always and numNotReportedClient
can never be < 0. Therefore plural version of the error message is
sufficient. Attached a patch to fix it.

@@ -1200,10 +1200,8 @@ reportDependentObjects(const ObjectAddresses
*targetObjects,
        {
                ereport(msglevel,
                /* translator: %d always has a value larger than 1 */
-                               (errmsg_plural("drop cascades to %d
other object",
-                                                          "drop
cascades to %d other objects",
-
numReportedClient + numNotReportedClient,
-
numReportedClient + numNotReportedClient),
+                               (errmsg("drop cascades to %d other objects",
+                                                numReportedClient +
numNotReportedClient),
                                 errdetail("%s", clientdetail.data),
                                 errdetail_log("%s", logdetail.data)));

Regards,
Bharath Rupireddy.

Вложения

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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Remove an unnecessary errmsg_plural in dependency.c