Re: Replacing a table with constraints

Поиск
Список
Период
Сортировка
От Ing. Jhon Carrillo
Тема Re: Replacing a table with constraints
Дата
Msg-id 01c301c557ec$9983b090$1400a8c0@tgusta2
обсуждение исходный текст
Ответ на Replacing a table with constraints  ("Mark Fenbers" <Mark.Fenbers@noaa.gov>)
Ответы Re: Replacing a table with constraints
Список pgsql-sql
Use          Drop table YOUR_TABLE cascade
 
Jhon Carrillo
Ingeniero en Computación
Caracas - Venezuela
 
 
----- Original Message -----
Sent: Friday, May 13, 2005 2:38 PM
Subject: [SQL] Replacing a table with constraints

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



---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Mark Fenbers"
Дата:
Сообщение: Replacing a table with constraints
Следующее
От: "Mark Fenbers"
Дата:
Сообщение: Re: Replacing a table with constraints