Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34]) by hub.org (8.9.3/8.9.3) with ESMTP id DAA35588 for ; Mon, 17 May 1999 03:36:54 -0400 (EDT) (envelope-from Inoue@tpf.co.jp) Received: from cadzone ([126.0.1.40] (may be forged)) by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP id QAA01260; Mon, 17 May 1999 16:36:31 +0900 From: "Hiroshi Inoue" To: "Vadim Mikheev" Cc: "pgsql-hackers" Subject: RE: [HACKERS] DROP TABLE does not drop a table completely Date: Mon, 17 May 1999 16:40:56 +0900 Message-ID: <000801bea038$993d59a0$2801007e@cadzone.tpf.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Importance: Normal In-Reply-To: <373FBEBF.C09E99B@krasnet.ru> > -----Original Message----- > From: root@sunpine.krs.ru [mailto:root@sunpine.krs.ru]On Behalf Of Vadim > Mikheev > Sent: Monday, May 17, 1999 4:01 PM > To: Hiroshi Inoue > Cc: pgsql-hackers > Subject: Re: [HACKERS] DROP TABLE does not drop a table completely > > > Hiroshi Inoue wrote: > > > > > > > > > > ERROR: cannot open segment 1 of relation sessions_done_id_index > > > > > > > > > > I got the same error in my test cases. > > > I don't understand the cause of this error. > > > > > > > I got this error message by dropping a table while concurrent > transactions > > inserting rows to the same table. > > > > I think other transactions should abort with message "Table does not > > exist". But in most cases the result is not so. > > > > It seems that other transactions could proceed before DROP TABLE > > command is completed. > > > > AFAIC heap_destroy_with_catalog() acquires AccessExclusiveLock and > > releases the lock inside the function. > > > > I think that heap_destroy_with_catalog() (or upper level > function) should > > not > > release the lock. > > You're right - this should be done keeping in mind that DROP is allowed > inside BEGIN/END (long transactions), but I'm not sure that this > will help generally: does it matter when unlock dropped relation - > in heap_destroy_with_catalog() or in commit? Unlocking dropped relation before commit enables other transactions proceed and the transactions regard the relation as still alive before the ^^^^^^^^^ commit of DROP TABLE command(It's right,I think). As a result,those transactions behave strangely,though I don't know more about the reason. Thanks. Hiroshi Inoue Inoue@tpf.co.jp