Re: Remove redundant assignment of a variable in function AlterPublicationTables
От | Chao Li |
---|---|
Тема | Re: Remove redundant assignment of a variable in function AlterPublicationTables |
Дата | |
Msg-id | CA8A569D-2D63-4EB4-8788-DFF5522FF40B@gmail.com обсуждение исходный текст |
Ответ на | Remove redundant assignment of a variable in function AlterPublicationTables (Shlok Kyal <shlok.kyal.oss@gmail.com>) |
Ответы |
Re: Remove redundant assignment of a variable in function AlterPublicationTables
|
Список | pgsql-hackers |
On Aug 20, 2025, at 16:41, Shlok Kyal <shlok.kyal.oss@gmail.com> wrote:Hi,
While working on the thread [1]. We encountered that in the
'AlterPublicationTables' function, the assignment 'isnull = true' is
redundant. This assignment is not required, and the variable will be
reassigned before use.
I have attached a patch to address this.
[1]: https://www.postgresql.org/message-id/CALdSSPgiDj8S8POf_6kiUkVrt9-EqYmn%2B2ahDqpdBpyteeAz-Q%40mail.gmail.com
Thanks,
Shlok Kyal
<v1-0001-Remove-redundant-assignment-of-isnull-variable.patch>
If we look into the subsequent functions, yes, “isnull” will always be assigned. But how about if someone incidentally changed a subsequent function and moved an assignment? I think giving an initial value is a good habit without much performance burden.
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
HighGo Software Co., Ltd.
https://www.highgo.com/
В списке pgsql-hackers по дате отправления: