Robert Haas wrote: > I don't understand what a weighted constraint would mean. Either the > attacker_id can be a wolf, or it can't. Knowing that it is only 1% > likely over the long haul is insufficient to disallow any particular > transaction.
Basically I suggested to combine the constraint with a probability. If the probability of one animal attacking another is 0% it can't attack the other animal - that's a strict constraint. The other way around it can, and you'll also immediately know how likely that is to happen. An added bonus is that you can generalize certain constraints. If certain animals are less than - say 25% - likely to attack other certain other animals you could determine that the attacked animal is not in fact prey. An example would probably be wolves attacking other wolves (or predators in general). For relations that depend on an animal being prey, a constraint would be that this number be <25%. In this discussion it is also not entirely defined what attacking means. Is a ram defending his horde from wolves attacking (wolves)? I realise this all started from an analogy to a real problem, so most of this is probably not very relevant to your actual problem. No less interesting, though. -- Alban Hertroys [EMAIL PROTECTED] magproductions b.v. T: ++31(0)534346874 F: ++31(0)534346876 M: I: www.magproductions.nl A: Postbus 416 7500 AK Enschede // Integrate Your World // ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/