On Fri, Oct 8, 2010 at 11:50 AM, Tom Lane wrote:
I think the
right thing here is to replace "before" with a three-valued enum,
perhaps called "timing", so as to force people to take another look
at any code that touches the field directly.
+1. That seems much nicer.
Although we already have macros TRIGGER_FIRED_AFTER/TRIGGER_FIRED_BEFORE
that seem to mask the details here, the changes you had to make in
contrib illustrate that the macros' callers could still be embedding this
basic mistake of testing "!before" when they mean "after" or vice versa.
I wonder whether we should intentionally rename the macros to force
people to take another look at their logic.  Or is that going too far?
Comments anyone?
I'm less sold on this one.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 20 of 24 | next ›
Discussion Overview
grouppgsql-hackers @
categoriespostgresql
postedAug 15, '10 at 5:38p
activeOct 11, '10 at 7:54a
posts24
users6
websitepostgresql.org...
irc#postgresql

People

Translate

site design / logo © 2021 Grokbase