Re: references versus foreign keys - Mailing list pgsql-novice

From Tom Lane
Subject Re: references versus foreign keys
Date
Msg-id 20299.1140980760@sss.pgh.pa.us
Whole thread Raw
In response to references versus foreign keys  (Tom Allison <tallison@tacocat.net>)
List pgsql-novice
Tom Allison <tallison@tacocat.net> 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

pgsql-novice by date:

Previous
From: Tom Allison
Date:
Subject: references versus foreign keys
Next
From: Krishnaprasad
Date:
Subject: Re: Regarding PL/SQL with C