Re: references versus foreign keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tom Allison <tallison(at)tacocat(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: references versus foreign keys
Date: 2006-02-26 19:06:00
Message-ID: 20299.1140980760@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tom Allison <tallison(at)tacocat(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Krishnaprasad 2006-02-27 03:54:33 Re: Regarding PL/SQL with C
Previous Message Tom Allison 2006-02-26 18:26:35 references versus foreign keys