X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7D0BE52A73 for ; Fri, 13 May 2005 15:38:38 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96857-04 for ; Fri, 13 May 2005 18:38:32 +0000 (GMT) Received: from werhmsg.werh.noaa.gov (werhmsg.werh.noaa.gov [198.206.32.236]) by svr1.postgresql.org (Postfix) with ESMTP id 12A92533CF for ; Fri, 13 May 2005 15:38:29 -0300 (ADT) Received: from [198.206.42.50] ([198.206.42.50]) by werhmsg.werh.noaa.gov (Netscape Messaging Server 4.15) with ESMTP id IGFYG300.741 for ; Fri, 13 May 2005 14:38:27 -0400 Message-ID: <4284F421.10809@noaa.gov> Date: Fri, 13 May 2005 14:38:25 -0400 From: "Mark Fenbers" Organization: DoC/NOAA/NWS/OHRFC User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Replacing a table with constraints Content-Type: multipart/mixed; boundary="------------000607070806050505090509" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.302 tagged_above=0 required=5 tests=AWL, HTML_20_30, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200505/98 X-Sequence-Number: 21411 This is a multi-part message in MIME format. --------------000607070806050505090509 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I have a table called Counties which partially contains a lot bad data.  By" bad data", I mean some records are missing; some exist and shouldn't; and some records have fields with erroneous information.  However, the majority of the data in the table is accurate.  I have built/loaded a new table called newCounties with the same structure as Counties, but contains no bad data.  My was  to completely replace the contents of Counties with the contents of newCounties.  The problem is: several other tables have Foreign Key constraints placed on Counties.  Therefore, Pg will not let me 'DELETE FROM Counties;", nor will it let me "DROP TABLE Counties;" 

I'm perplexed.  Can someone suggest how I can best get data from Counties to look just like newCounties?

Mark
--------------000607070806050505090509 Content-Type: text/x-vcard; charset=utf-8; name="Mark.Fenbers.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Mark.Fenbers.vcf" begin:vcard fn:Mark Fenbers n:Fenbers;Mark org:DoC/NOAA/NWS/OHRFC adr:;;1901 South SR 134;Wilmington;OH;45177-9708;USA email;internet:Mark.Fenbers@noaa.gov title:Sr. HAS Meteorologist tel;work:937-383-0430 x246 x-mozilla-html:TRUE url:http://weather.gov/ohrfc version:2.1 end:vcard --------------000607070806050505090509--