-----Original Message----- From: pgsql-sql-ow...@postgresql.org [mailto:pgsql-sql-ow...@postgresql.org] On Behalf Of Adrian Klaver Sent: Thursday, January 12, 2012 11:55 AM To: pgsql-sql@postgresql.org Cc: Carlos Mennens Subject: Re: [SQL] Unable To Modify Table > > How does one accomplish my goal? Is this difficult to change or once > that foreign key is created, are you stuck with that particular > constraint?
You are pushing in the wrong direction. You need to make the change in the table 'orders'. This assumes the FK in 'orders' has ON UPDATE CASCADE enabled. ---------------------------------------- Adrian, you are not helping...if ON UPDATE CASCADE was enabled on "orders" the error in question would never have appeared and the UPDATE would have succeeded. Carlos' goal is to change the value of a Primary Key that has already been used in a FOREIGN KEY constraint and he needs to learn to use the documentation to solve some of these basic questions instead of asking the list. His approach is correct, execute UPDATE against the "developers" table. Deferrable constraints and transactions work as well but are more complicated to setup and execute compared to the more direct ON UPDATE CASCADE modifier to the FOREIGN KEY. But learning both methods is good. David J. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql