Unix Technical Forum

How to overwrite a table [only data]?

This is a discussion on How to overwrite a table [only data]? within the pgsql Interfaces Pgadmin Support forums, part of the PostgreSQL category; --> Hi list, I would like to overwrite a table with problem with his original. But there are some points. ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces Pgadmin Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 07:34 PM
Ezequias Rodrigues da Rocha
 
Posts: n/a
Default How to overwrite a table [only data]?

Hi list,

I would like to overwrite a table with problem with his original. But there
are some points.

I can't just delete and restore it becouse it has a foreign key and when I
try to delete it ask for drop cascade.

As I know the drop cascade delete in both tables the rows related. Is it
correct ?


Regards...

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Atenciosamente (Sincerely)
Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 07:34 PM
Harald Armin Massa
 
Posts: n/a
Default Re: How to overwrite a table [only data]?

Ezequias ,

>
> I would like to overwrite a table with problem with his original. But
> there are some points.
>
> I can't just delete and restore it becouse it has a foreign key and when I
> try to delete it ask for drop cascade.
>
> As I know the drop cascade delete in both tables the rows related. Is it
> correct ?
>
> You are right.


Your database structure disallows this kind of deletes.

So, if you want to allow it, you have to disable / remove that foreign key
restriction, refresh your data, and reimplement that restriction.

Be aware that foreign key restrictions usually are there for a reason.

Harald




--
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607
-
Python: the only language with more web frameworks than keywords.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com