Re: complex referential integrity constraints

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: complex referential integrity constraints
Дата
Msg-id 45E2A529.2050609@magproductions.nl
обсуждение исходный текст
Ответ на Re: complex referential integrity constraints  ("Robert Haas" <Robert.Haas@dyntek.com>)
Ответы Re: complex referential integrity constraints  ("Robert Haas" <Robert.Haas@dyntek.com>)
Список pgsql-general
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
alban@magproductions.nl

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 //

В списке pgsql-general по дате отправления:

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: General Ledger db design
Следующее
От: Dave Page
Дата:
Сообщение: Re: PostgreSQL on Windows Paper