[PATCH] EnableDisableTrigger Cleanup & Questions

Поиск
Список
Период
Сортировка
От Jonah H. Harris
Тема [PATCH] EnableDisableTrigger Cleanup & Questions
Дата
Msg-id 36e682920811052103v772f27dbs733861ddaba2cf2e@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] EnableDisableTrigger Cleanup & Questions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] EnableDisableTrigger Cleanup & Questions  ("Jonah H. Harris" <jonah.harris@gmail.com>)
Список pgsql-hackers
While working on the join elimination patch, I was going through the
trigger code and found quite a bit of nastiness in regard to naming
and variable repurposing related to the addition of replication roles
in 8.3.  The most obvious issue is that tgenabled was switched from a
bool to char to support replication roles.  From a naming standpoint,
the term "enabled" generally implies boolean and is fairly
consistently used as such in other functions within the core.  My
initial preference would be to return tgenabled to its original
boolean for use only in enabling/disabling triggers.  Then, I'd
probably add another boolean entry (tgreplica?) for use in determining
whether the trigger should be fired on origin/local or replica.
Otherwise, the naming of EnableDisableTrigger and friends seems a bit
contradictory due to the fact that it has the ability to convert a
trigger into a replica trigger.  Similarly, I can't see any reason for
keeping the structure member name the same, especially when the change
from bool to char broke backward compatibility anyway.  Thoughts?

As I wasn't sure whether anyone agrees with my distaste for
repurposing tgenabled as mentioned above, I have attached is a patch
which minimally corrects the function comment for EnableDisableTrigger
where fires_when is concerned.

--
Jonah H. Harris, Senior DBA
myYearbook.com

Вложения

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

Предыдущее
От: "Jaime Casanova"
Дата:
Сообщение: Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1
Следующее
От: Unicron
Дата:
Сообщение: My review for the patch "Table command"