X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 01D4DD1C4BF; Wed, 13 Aug 2003 18:15:00 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 50821-04; Wed, 13 Aug 2003 15:13:22 -0300 (ADT) Received: from ssmcmail.nems.noaa.gov (ssmcmail.nems.noaa.gov [205.156.4.221]) by svr1.postgresql.org (Postfix) with ESMTP id 002D8D1B53A; Wed, 13 Aug 2003 15:14:45 -0300 (ADT) Received: from noaa.gov ([140.90.7.155]) by ssmcmail.nems.noaa.gov (Netscape Messaging Server 4.15) with ESMTP id HJKLCI00.Q1N; Wed, 13 Aug 2003 14:14:42 -0400 Message-ID: <3F3A8010.9030701@noaa.gov> Date: Wed, 13 Aug 2003 14:14:40 -0400 From: Raymond Chui Organization: NOAA NWS User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en, zh, zh-CN, zh-TW, ja, ko, zh-cn, zh-hk, zh-sg MIME-Version: 1.0 To: pgsql-general@postgresql.org, pgsql-admin@postgresql.org, pgsql-sql@postgresql.org Subject: Why table has drop, but the foreign key still there? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/160 X-Sequence-Number: 9882 Here are the simple things I did create table state ( state_code char(2) not null, state varchar(15) not null, primary key (state_code) ); create table whitepage ( user_id char(8) not null, email varchar(50), telephone char(16) not null, contact_name varchar(30) not null, city varchar(20), state_code char(2), primary key (user_id), foreign key (state_code) references state (state_code) ); insert into state (state_code,state) values ('GU','Guam'); drop table whitepage; delete from state where state_code = 'GU'; ERROR: Relation "whitepage" does not exist Why I got this error message??!! The whitepage table already drop. When the table drop, will the foreign key constraint also drop?? Now, order for me delete a row from state table, I HAVE TO re-create whitepage table. That's silly!!! What shall I do? How do I delete a row in state without re-create the whitepage table??? Thank you very much in advance!