Re: Correct implementation of 1:n relationship with n>0?

Поиск
Список
Период
Сортировка
От Wolfgang Keller
Тема Re: Correct implementation of 1:n relationship with n>0?
Дата
Msg-id 20130514203326.5b7d2b667c67f60a6708ade2@gmx.net
обсуждение исходный текст
Ответ на Re: Correct implementation of 1:n relationship with n>0?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-sql
> > The point is that I would have expected that problem to be solved
> > within the past four decades since relational databases have been
> > invented. Or at least in the past two decades since PostgreSQL has
> > been developed.
> 
> Then what about n>1, n>2, n>k where k an arbitrarily large positive
> integer? isn't it the same problem class actually?

Not quite.

In conceptual modeling, relationships between entities aren't directed.
And there's no reason to not have a "not null" constraint on any of the
two sides of a one-to-many (or many-to-many) relationship from the
conceptual point of view.

The way relationships are implemented in physical database schemas, by
foreign key constraints, just makes it non-trivial to implement such a
"not null" constraint on the "wrong" end of a one-to-many relationship.
But this a technical issue with the implementation of databases at the
physical level, not a conceptual issue.

> Is there any serious database vendor who provides out of the box
> support for 1:n, n>0 ? Or is it an "unusual" user requirement in the
> first place.

It definitely is not, since conceptual diagrams I have seen are full of
such relationships. They're just never correctly implemented at the
physical level.

> Ever thought why not so many people have asked for this?

Having quite some professional experience in companies, I don't doubt
for a second that the very only reason is simply total absence of care
for scientific correctness of database at the level of the physical
implementation.
Sincerely,

Wolfgang



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

Предыдущее
От: Igor Neyman
Дата:
Сообщение: Re: array_agg() with join question
Следующее
От: George Woodring
Дата:
Сообщение: Re: array_agg() with join question