[Rt-devel] About data integrity rules

Rafael Martinez r.m.guerrero at usit.uio.no
Mon Feb 11 13:58:07 EST 2008

Jesse Vincent wrote:
>> A minus for this method is that you have to have a table per ObjectType
>> that inherits from the main table.
> So, we'd need a table per object type per thing we want this arbitrary 
> keying into. CustomFields, ACLs, Transactions, Links (and links do it 
> twice).

Yes, with the data model in use, this is the only way I can think of (We 
are talking only about 4-5 object types, right?)

> And it only works on Postgres.  This is just about the only option that 
> we ever came up with when we explored the possibilities. And it really 
> just doesn't feel like a good tradeoff to me.

The only thing I have found in MySQL with some similarity to 
SQL-inheritance is "MERGE Storage Engine" [1] and it only works with 
MyISAM tables so it is not really a solution.

I suppose that you could implement 'foreign key checks' using triggers 
instead of the 'foreign key check implementation of the database', but I 
have never done this. This should work with both MySQL and PostgreSQL 
but I don't know how effective this solution would be.

[1]: http://dev.mysql.com/doc/refman/5.0/en/merge-storage-engine.html

  Rafael Martinez, <r.m.guerrero at usit.uio.no>
  Center for Information Technology Services
  University of Oslo, Norway

  PGP Public Key: http://folk.uio.no/rafael/

More information about the Rt-devel mailing list