Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 4535818E38D9 for ; Thu, 12 Jan 2012 13:02:58 -0400 (AST) Received: from smtp101.prem.mail.ac4.yahoo.com ([76.13.13.40]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1RlO3E-00023g-16 for pgsql-sql@postgresql.org; Thu, 12 Jan 2012 17:02:57 +0000 Received: (qmail 50160 invoked from network); 12 Jan 2012 17:02:42 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=kHh6DU9qq5hE588gKWhZ88oKW4QtYWA1m+j0TLCU16NCxiCOOk6gtoMZJelDOjBXE3qXTdWb/IMInZmfX9luH/IMJYZmkUDM8iDi76+bMcV4iy+rdRLQIcja85osoPUGYakOkpgz7iufPxDk3p786KuS+L9mte/5K+czuoAfOW4= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326387762; bh=bf81fSZFjYdnXFNZSQylBMvUW1EO8iE8VwqtoCKJ27w=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:X-Mailer:Thread-Index:Content-Language; b=rIfEn1w5/4K70bTpeBCHcdXIJ9hWNMzotuydYmLk2NOF719vRAEE8Z6+h/1xjQA/cA23LGwLmQqpZWZY3YsYTdUPW13/6ZEI9+msO+u78BLpr9qz1CtKSucysVPUgUlTqjtuR29UGOiMk14I9OIImLc0nnkpZOb8YjUEyLv2oEw= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: WzezDfgVM1kTgd2.xXImLuEZ3CZtgiBaioghElU_ZKPR2ic RM1DmNX5e3Xo0Z2CBNpuDskHey.npAd7h3WChv4H2XCOhqKkbXonkBvrUxje ByeQbx3XkiBCg9H5i0Nmw47zIhMe1KRTY8QwGUIPlVrS.dYda2maG05uoOUR JcJ1.ADH2I.PF01qzhFrYDtcHTwRFyekWr9FHN9_0ES2m2KlouAAAoFWrTS_ NM2ZUJ5G_cLhujECbG3AfkiSfy9qvQhYlCQL_J9bRAiPzxDu4IpSMMxuZLNc CWeqQ4Yf5EUzT8URqAUGhIxavhiG4APOE2eZv.ZiNcFxru_S0gaJiXO.eGwY ZqQMlSfPslSXb5ad7ExLvph_.qk_VSXf_ykE6tjUh0lRL5AVEv9DI4Gy9uYg 7NQYwup4ibKDk7hFAP178 X-Yahoo-SMTP: mpGJl6eswBD2IBufoVEg0Pa8gg-- Received: from WolfDog (polobo@24.93.23.188 with login) by smtp101.prem.mail.ac4.yahoo.com with SMTP; 12 Jan 2012 09:02:42 -0800 PST From: "David Johnston" To: "'Adrian Klaver'" , Cc: "'Carlos Mennens'" References: <201201120854.42306.adrian.klaver@gmail.com> In-Reply-To: <201201120854.42306.adrian.klaver@gmail.com> Subject: Re: Unable To Modify Table Date: Thu, 12 Jan 2012 12:02:35 -0500 Message-ID: <017101ccd14b$fbc0f120$f342d360$@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQGWi74kGEZ3ig7om2OmmMWFDJ8cXQGOh8OPlmkKw1A= Content-Language: en-us X-Pg-Spam-Score: -2.0 (--) X-Archive-Number: 201201/50 X-Sequence-Number: 36221 -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@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.