redundant check of msg in does_not_exist_skipping

Поиск
Список
Период
Сортировка
От Ted Yu
Тема redundant check of msg in does_not_exist_skipping
Дата
Msg-id CALte62yFakR4POxT590JOEN65fhHNXeZg+X879Gy34_2p8UjMQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: redundant check of msg in does_not_exist_skipping  (Japin Li <japinli@hotmail.com>)
Список pgsql-hackers
Hi,
I was looking at commit aca992040951c7665f1701cd25d48808eda7a809

I think the check of msg after the switch statement is not necessary. The variable msg is used afterward.
If there is (potential) missing case in switch statement, the compiler would warn.

How about removing the check ?

Thanks

diff --git a/src/backend/commands/dropcmds.c b/src/backend/commands/dropcmds.c
index db906f530e..55996940eb 100644
--- a/src/backend/commands/dropcmds.c
+++ b/src/backend/commands/dropcmds.c
@@ -518,9 +518,6 @@ does_not_exist_skipping(ObjectType objtype, Node *object)

             /* no default, to let compiler warn about missing case */
     }
-    if (!msg)
-        elog(ERROR, "unrecognized object type: %d", (int) objtype);
-
     if (!args)
         ereport(NOTICE, (errmsg(msg, name)));
     else

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

Предыдущее
От: Pavel Borisov
Дата:
Сообщение: Re: Lockless queue of waiters in LWLock
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Typo in SH_LOOKUP and SH_LOOKUP_HASH comments