Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 25EA99FB401 for ; Wed, 4 Oct 2006 08:50:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 87949-03 for ; Wed, 4 Oct 2006 08:50:38 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by postgresql.org (Postfix) with ESMTP id 0570B9FB3FE for ; Wed, 4 Oct 2006 08:50:37 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d80so231855pyd for ; Wed, 04 Oct 2006 04:50:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=BTnjj8hX+hrzFjq/zfzDjAiEY7+jTqZQmDm28B0gDZnRxNbae21xXqm2XsAy//EXCL6VVtCcGyTGWXa3TuTIQKUAIn+KjGsrHkU46mN6VYEK3f9Y3DLdWv+itxXXAZFep5dGmj5uI0TVxUb0YehlR6MUHk4M0dT1UIq8uJZjOtE= Received: by 10.35.18.18 with SMTP id v18mr1045650pyi; Wed, 04 Oct 2006 04:50:36 -0700 (PDT) Received: by 10.35.123.13 with HTTP; Wed, 4 Oct 2006 04:50:36 -0700 (PDT) Message-ID: <7be3f35d0610040450v2cf4ea3cm24629e3caa925f9d@mail.gmail.com> Date: Wed, 4 Oct 2006 13:50:36 +0200 From: "Harald Armin Massa" To: "Ezequias Rodrigues da Rocha" Subject: Re: How to overwrite a table [only data]? Cc: "pgAdmin Support" , pgsql-sql@postgresql.org In-Reply-To: <55c095e90610040440v431e15a3m34fa72ef19c239e8@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_126897_16715249.1159962636212" References: <55c095e90610040440v431e15a3m34fa72ef19c239e8@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.458 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/12 X-Sequence-Number: 5849 ------=_Part_126897_16715249.1159962636212 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --=20 GHUM Harald Massa persuadere et programmare Harald Armin Massa Reinsburgstra=DFe 202b 70197 Stuttgart 0173/9409607 - Python: the only language with more web frameworks than keywords. ------=_Part_126897_16715249.1159962636212 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 co= rrect ?

You are right.

Your database structure disallows = this kind of deletes.

So, if you want to allow it, you have to disa= ble / remove that foreign key restriction, refresh your data, and reimpleme= nt that restriction.

Be aware that foreign key restrictions usually are there for a reas= on.

Harald




--
GHUM Harald Massa
persuadere= et programmare
Harald Armin Massa
Reinsburgstra=DFe 202b
70197 St= uttgart
0173/9409607
-
Python: the only language with more web frameworks= than keywords. ------=_Part_126897_16715249.1159962636212--