Re: *Proper* solution for 1..* relationship?

Поиск
Список
Период
Сортировка
От Wolfgang Keller
Тема Re: *Proper* solution for 1..* relationship?
Дата
Msg-id 20130429184304.1862af6c16d511b2e73f8bb5@gmx.net
обсуждение исходный текст
Ответ на Re: *Proper* solution for 1..* relationship?  (Richard Broersma <richard.broersma@gmail.com>)
Список pgsql-novice
> If you want to enforce a 1 to N relationship, You can use a CONSTRAINT
> TRIGGER on the List table to ensure that there is at least one list
> item - if there isn't then raise an exception 'No List Items!!!'.
> You'd want to define the constraint as INITIALLY DEFERRED.
> http://www.postgresql.org/docs/9.2/interactive/sql-createtrigger.html
> http://www.postgresql.org/docs/9.2/interactive/sql-set-constraints.html
>
> A constraint trigger is the closest feature to an ASSERTION statement
> defined by the SQL standard.

Thanks, but the main issue for me is the precise definition of the
constraint to apply.

This issue should be as old as relational databases per se. I just can't
imagine no one has implemented a well-proven "standard" solution yet.

Sincerely,

Wolfgang


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

Предыдущее
От: Richard Broersma
Дата:
Сообщение: Re: *Proper* solution for 1..* relationship?
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: *Proper* solution for 1..* relationship?