references versus foreign keys
references versus foreign keys
От:
Tom Allison <tallison@tacocat.net>
Дата:
Maybe this is too much of a noob question but bear with me. I'm assuming that I have a choice between CREATE TABLE (..) REFERENCES other and CREATE TABLE (..) FOREIGN KEY () REFERENCES other What is the differences between the two and why/when would I choose one over the other?
Re: references versus foreign keys
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Tom Allison writes: > Maybe this is too much of a noob question but bear with me. > I'm assuming that I have a choice between > CREATE TABLE (..) REFERENCES other > and > CREATE TABLE (..) FOREIGN KEY () REFERENCES other > What is the differences between the two and why/when would I choose one over the > other? You have to use the more verbose syntax to establish a multi-column reference. For single-column keys it doesn't matter which way you do it. regards, tom lane