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)
Список
Дерево обсуждения
*Proper* solution for 1..* relationship? Wolfgang Keller <feliphil@gmx.net>
Re: *Proper* solution for 1..* relationship? David Johnston <polobo@yahoo.com>
Re: *Proper* solution for 1..* relationship? Kevin Grittner <kgrittn@ymail.com>
Re: *Proper* solution for 1..* relationship? Wolfgang Keller <feliphil@gmx.net>
Re: *Proper* solution for 1..* relationship? David Johnston <polobo@yahoo.com>
Re: *Proper* solution for 1..* relationship? Wolfgang Keller <feliphil@gmx.net>
Re: *Proper* solution for 1..* relationship? David Johnston <polobo@yahoo.com>
Re: *Proper* solution for 1..* relationship? Kevin Grittner <kgrittn@ymail.com>
Re: *Proper* solution for 1..* relationship? David Johnston <polobo@yahoo.com>
Re: *Proper* solution for 1..* relationship? Richard Broersma <richard.broersma@gmail.com>
Re: *Proper* solution for 1..* relationship? Simon Riggs <simon@2ndQuadrant.com>
Re: *Proper* solution for 1..* relationship? Josh Kupershmidt <schmiddy@gmail.com>
Re: *Proper* solution for 1..* relationship? Gavin Flower <GavinFlower@archidevsys.co.nz>
Re: *Proper* solution for 1..* relationship? Richard Broersma <richard.broersma@gmail.com>
Re: *Proper* solution for 1..* relationship? Wolfgang Keller <feliphil@gmx.net>
> 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 по дате отправления