[Pdx-pm] Eliminating circular table relations.

David E. Wheeler david at kineticode.com
Wed Jan 31 11:53:46 PST 2007

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. [1]

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.



More information about the Pdx-pm-list mailing list