Re: referential integrity on existing table - Mailing list pgsql-general

From Patrick Welche
Subject Re: referential integrity on existing table
Date
Msg-id 20011210205702.G2303@quartz.newn.cam.ac.uk
Whole thread Raw
In response to referential integrity on existing table  ("Adam Fisher" <black@cia.com.au>)
List pgsql-general
On Fri, Dec 07, 2001 at 11:00:22AM +1100, Adam Fisher wrote:
> My question is, is it possible to create a referential integrity constraint
> on an exisiting, already populated, table??

Yes, cf:

ALTER TABLE table
    ADD table constraint definition

eg:

alter table "tblAddress"
  add constraint addfk
  foreign key("PersonID") references "tblPerson"("ID") match full;

Cheers,

Patrick

pgsql-general by date:

Previous
From: Andrew Gould
Date:
Subject: Re: Access and Boolean
Next
From: Chris Albertson
Date:
Subject: Need SQL help, I'm stuck.