> I'm no expert on this, but PostgreSQL does have a foreign key implementation,
> albeit a somewhat cumbersome IMO. You should look the refint (referential
> integrity) stuff in the contrib directory of the sourcetree. Since I don't
> have a sourcetree lying around at the moment, I can't verify the exact name
> of the directory. The goodies may be located in the SDI (or something similar)
> directory. What it boils down to is that you use triggers to enforce referential
> integrity. It works just fine, but is a bit labourious to setup.
The old contrib/spi/refint.c is obsolete now. You should use the new
implementation. Go to www.postgresql.org and search for Jan Wieck's TODO
page about reference integrity, you will find the exact syntax there.
Examples can be found in the mailing list, also on www.postgresql.org.
Regards,
Zoltan