[ic] referential integrity/table constraints? - 4.8.6 and 4.9.5 for postgresql

Mike Heins interchange-users@icdevgroup.org
Thu Mar 27 10:52:01 2003


Quoting Andrew C. (linuxdev@musicalheritage.org):
> March 27, 2003
> 
> Hello icdevgroup.  I was just wondering if there is a way to enforce
> referential integrity in interchange databases if I am using Postgresql
> with Interchange 4.8.6 and also 4.9.5?  Can foreign keys be used and if
> so how are they declared in the table configuration files in /dbconf/

I don't see why you can't create your table outside of IC and then
just reference it.

If you want to, you can use

Database foo CREATE_SQL  <<EOF
create table foo (
   ....
)
EOF

It will then be used instead of the stuff Interchange generates.

> Would I just have to run the sql statements after the postgres database
> I am using with IC has built the table from the text table definition
> files in /dbconf?

But why do that? If you want to have a complex structure wouldn't you
create your database with other tools?


> I am also slightly confused on table relationships in postgres?  I
> thought setting up primary/foreign key relationships would enforce
> referential integrity?  Where do Reference Constraints and Constraint
> Triggers come into play and how do they differ?
> 

There you are on your own. If you want to use such things, you have to
supply the expertise.

Bottom line is that IC does not prevent you from using foreign key constraints;
but it doesn't help you either.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

In character, in manners, in style, in all things, the supreme excellence
is simplicity. -- Longfellow