[Pdx-pm] Eliminating circular table relations.
Michael G Schwern
schwern at gmail.com
Wed Jan 31 13:15:32 PST 2007
David E. Wheeler wrote:
> On Jan 31, 2007, at 10:48 AM, Michael G Schwern wrote:
>> I could add in a constraint to the account table to check that a meat
>> or mushroom account exists, but now I have a circular dependency.
>> That's bad. It means in order to create or delete an account I have
>> to defer constraint checking while I create (or delete) both the
>> account row and the associated sub-type row. To add to the problem,
>> this is MySQL 5.0 which does not have proper constraint deferral. 
> Pity. If it was PostgreSQL or SQLite, I have answers a-ready (views +
> rules/triggers + permissions). But for MySQL, well, your SOL in
> enforcing this type of stuff at the database level. You'll have to
> enforce it in your application code, like all "good" MySQL applications do.
Let's hear those answers. I'm building up a case for Postgres here and the more ammo the better.
More information about the Pdx-pm-list