On Aug 15, 2005, at 1:57 PM, Chris Browne wrote:
> For someone to argue that implementing most business logic inside the
> DB isn't their favorite idea is something where there needs to be some
> room for disagreement :-).
>
I don't disagree but after doing quite a bit of PHP the last few
weeks (using Drupal) I see more clearly why most people don't go to
the trouble. I can create all kinds of constraints in my database but
when I go to save a row that might violate several of them, I'll only
get one error back. This won't work in a web form interface where I
should provide feedback on all of the errors at once rather than one
at a time. So if I want this validation logic to be available at both
the application and database level, I have to somehow parse it from
the database or create some superset of the specification that will
work in the application and create the constraints in the database.
Otherwise, I need to maintain the constraints in both places and keep
them in sync.
John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL