ALTER TABLE to add Foreign Key Constraint

Поиск
Список
Период
Сортировка
От Vipin Samtani
Тема ALTER TABLE to add Foreign Key Constraint
Дата
Msg-id 394BD376.4D79D700@attglobal.net
обсуждение исходный текст
Ответы Re: ALTER TABLE to add Foreign Key Constraint
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Andrew Snow"
Дата:
Сообщение: RE: Lock rekord
Следующее
От: brianb-pggeneral@edsamail.com
Дата:
Сообщение: Backend died while dropping index