James Kitambara wrote: > For this UPDATE I wanted, when I change the region _id from '99' to > '33' of the last ROW in REGION table AUTOMATICALLY to change the > last three ROWS of the DISTRICT table which reference to '99', 'Dar > es Salaam'. > > If I do this, I will get the error message "You can not change > region_id other tables are reference to it. > > HOW CAN DO THIS? (AUTOMATIC UPDATE OF FOREIGN KEY)
When you define your foreign key mark it "ON UPDATE CASCADE" (there is a similar option for ON DELETE). See manuals for details. -- Richard Huxton Archonet Ltd -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql