Обсуждение: Referential Integrity Problem on UPDATE

Поиск
Список
Период
Сортировка

Referential Integrity Problem on UPDATE

От
Nicole Lefresne
Дата:
When I try to update my tblCompanies with

     UPDATE tblcompanies SET tblcompanies.strname = 'Biscuit Inc' WHERE
tblcompanies.id = 18732;

I get the following error:
     ERROR: tblcompanies_address_fk referential integrity violation -
key in tbladdress still referenced from tblcompanies

My settings:
     - tblcompanies.addressid is a foreign key to tbladdress.id
     - the constraint in tblcompanies for the address id is:
               CONSTRAINT "tblcompanies_address_fk"
                     FOREIGN KEY ("addressid")
                     REFERENCES "tbladdress" ("id")
                     ON DELETE NO ACTION ON UPDATE CASCADE NOT
DEFERRABLE INITIALLY IMMEDIATE,
     - I am using postgresql 7.2.1

Has anyone else had a similar problem, or do you know of a solution to
this problem?

Many thanks
;->