From: Mark Fenbers <Mark.Fenbers@noaa.gov>
To: Ing. Jhon Carrillo <jdigital@cantv.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: Replacing a table with constraints
Date: Fri, 13 May 2005 15:55:44 -0400
Message-ID: <42850640.9090309@noaa.gov> (raw)
In-Reply-To: <01c301c557ec$9983b090$1400a8c0@tgusta2>
References: <4284F421.10809@noaa.gov>
<01c301c557ec$9983b090$1400a8c0@tgusta2>
This is a multi-part message in MIME format.
--------------060608000603070007090408
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#333399">
True, but Counties has about 8 or 9 rules, view, or pk constraints
attached to it. I don't want to break all these unless I knew of a way
to save off the SQL for them beforehand so I can easily rebuild them...<br>
Mark<br>
<br>
Ing. Jhon Carrillo wrote:
<blockquote cite="mid01c301c557ec$9983b090$1400a8c0@tgusta2" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2600.0" name="GENERATOR">
<style></style>
<div><font color="#000000" face="Arial" size="2">Use Drop
table YOUR_TABLE <strong>cascade</strong></font></div>
<div> </div>
<div><font color="#000000">Jhon Carrillo<br>
Ingeniero en Computación<br>
</font><font color="#000000">Caracas - Venezuela<br>
</font></div>
<div> </div>
<div> </div>
<div>----- Original Message ----- </div>
<blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div
style="background: rgb(228, 228, 228) none repeat scroll 0%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>From:</b>
<a title="Mark.Fenbers@noaa.gov" href="mailto:Mark.Fenbers@noaa.gov">Mark
Fenbers</a> </div>
<div
style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b>
<a title="pgsql-sql@postgresql.org"
href="mailto:pgsql-sql@postgresql.org">pgsql-sql@postgresql.org</a> </div>
<div
style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b>
Friday, May 13, 2005 2:38 PM</div>
<div
style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b>
[SQL] Replacing a table with constraints</div>
<div><br>
</div>
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;" <br>
<br>
I'm perplexed. Can someone suggest how I can best get data from
Counties to look just like newCounties?<br>
<br>
Mark<br>
<p> </p>
<hr> <br>
---------------------------(end of broadcast)---------------------------<br>
TIP 8: explain analyze is your friend<br>
</blockquote>
</blockquote>
</body>
</html>
--------------060608000603070007090408
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
--------------060608000603070007090408--
Attachments:Mark.Fenbers.vcf (text/x-vcard, 281B) download
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: Mark.Fenbers@noaa.gov, jdigital@cantv.net
Subject: Re: Replacing a table with constraints
In-Reply-To: <42850640.9090309@noaa.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox