Replacing a table with constraints - Mailing list pgsql-sql

From Mark Fenbers
Subject Replacing a table with constraints
Date
Msg-id 4284F421.10809@noaa.gov
Whole thread Raw
Responses Re: Replacing a table with constraints  (Ragnar Hafstað <gnari@simnet.is>)
List pgsql-sql
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
thedata 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
notlet me 'DELETE FROM Counties;", nor will it let me "DROP TABLE Counties;"  <br /><br /> I'm perplexed.  Can someone
suggesthow I can best get data from Counties to look just like newCounties?<br /><br /> Mark<br /> 

pgsql-sql by date:

Previous
From: Greg Stark
Date:
Subject: Re: interesting SQL puzzle - concatenating column with itself.
Next
From: "Ing. Jhon Carrillo"
Date:
Subject: Re: Replacing a table with constraints