ALTER TABLE to add Foreign Key Constraint

From: Vipin Samtani <vipin(at)attglobal(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: ALTER TABLE to add Foreign Key Constraint
Date: 2000-06-17 19:37:26
Message-ID: 394BD376.4D79D700@attglobal.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to designate foreign keys after tables "distributors" and
"addresses" have already been created with primary keys "distributor"
and "address" respectively. I am attempting to use ALTER TABLE to
accomplish this. I found this statement in the documentation

ALTER TABLE distributors ADD CONSTRAINT distfk FOREIGN KEY (address)
REFERENCES addresses(address) MATCH FULL

When I run it, I get this error:

ERROR: parser: parse error at or near "constraint"

What is wrong with the statement?

Vipin

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pranab 2000-06-17 19:55:06 pg_hba.conf password authentication problem
Previous Message Andrew Snow 2000-06-17 17:35:15 RE: Lock rekord