Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B475547638D for ; Tue, 3 Dec 2002 11:24:01 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 42782476692 for ; Tue, 3 Dec 2002 11:17:07 -0500 (EST) Received: from lamer.pl (localhost [127.0.0.1]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 504952B25C for ; Tue, 3 Dec 2002 17:03:24 +0100 (CET) From: "Tomasz Myrta" To: pgsql-sql@postgresql.org Subject: recreating table and foreign keys Date: Tue, 3 Dec 2002 17:03:24 +0800 Message-Id: <20021203170324.M63387@klaster.net> X-Mailer: Open WebMail 1.62 20020221 X-OriginatingIP: 217.96.97.138 (jasiek) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/34 X-Sequence-Number: 10622 Hi I use Postgresql 7.2.2. Sometimes I have to remove a column from my tables (psql): 1. alter table master_table rename to x; 2. \i tables.sql 3. insert into master_table select f1,f2,... from x 4. drop table x I think, foreign keys referring from detail_table(s) to master_table have gone. How to recreate foreign keys? I want to keep my database in better integrity, than now... Tomasz Myrta