Re: Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ......
От | Stephan Szabo |
---|---|
Тема | Re: Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ...... |
Дата | |
Msg-id | Pine.BSF.4.21.0107050953170.69990-100000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | Re: Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ...... (eddie iannuccelli <eddie.iannuccelli@toulouse.inra.fr>) |
Список | pgsql-general |
On Thu, 5 Jul 2001, eddie iannuccelli wrote: > Regrading your discussion, at the end, what is the difference between a > REFERENCE clause in a field definition and a FOREIGN KEY in the table > definition ? What is the best solution to implement a classical foreign > key in a table ? "If a <column constraint definition> is specified that contains a <references specification>, then it is equivalent to a <table constraint definition> that contains the followin g<table constraint>: CND FOREIGN KEY (C) <references specification> CA" The only major difference that you generally have to worry about is that table FOREIGN KEY constraints allow you to have multiple column key references. It's similar to the difference between the column and table level PRIMARY KEY specifications. Generally I personally use the column level one for single column keys and only use the table one for multiple column keys although that's mostly a matter of style. I'm sure there are people that use the table one for everything.
В списке pgsql-general по дате отправления: