> Desired Outcome(s):
> * I would like to have the convenience of declaring a column that obeys
> a constraint (similar to using a domain), but allows a "tidy-up" as the
> value is created BEFORE asserting the constraint. This *might* be
> termed a "domain trigger". (Perhaps even a WORM is possible!).
> * I would like to able to declare columns as
> "trimmed_varchar(n)".
> * I'd like to be able to use the same approach for other "weak domains".
I'm not sure these any easier way to do this than with tirggers.
If the daunting task would writing a large number of triggers, I would write
sql or php to generate all the triggers. Remember that you can introspect
the db using the system catalogs. I've had a lot of good results generating
triggers and sql using Middlegen and Velocity.