From: | "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com> |
---|---|
To: | "Pg Hackers" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | [PATCH] EnableDisableTrigger Cleanup & Questions |
Date: | 2008-11-06 05:03:04 |
Message-ID: | 36e682920811052103v772f27dbs733861ddaba2cf2e@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
Attachment | Content-Type | Size |
---|---|---|
endisable_trig_fctn_commnt_cleanup.patch | application/octet-stream | 2.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Unicron | 2008-11-06 05:26:18 | My review for the patch "Table command" |
Previous Message | Jaime Casanova | 2008-11-06 04:47:29 | Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1 |