Re: altering table

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Riza Fahmi <riza(dot)fahmi(at)myrealbox(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: altering table
Date: 2003-04-09 14:24:06
Message-ID: 20030409072151.A65184-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Wed, 9 Apr 2003, Riza Fahmi wrote:

> How to use alter table to add foreign key more than one field? Thanks
> for the attention

If you mean a multi-column foreign key:

alter table foo add constraint name foreign key (col1, col2, col3)
references bar(pcol1, pcol2,pcol3);

[The columns on bar are unnecessary if you're referencing the primary key]

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-04-09 14:43:36 Re: Cross database reference (databases are on the same
Previous Message Joshua Moore-Oliva 2003-04-09 14:21:49 Re: aaagh... postgres is segfaulting? -- fix