pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vadim Mikheev <vadim@krasnet.ru>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] DROP TABLE does not drop a table completely
Date: Mon, 17 May 1999 15:01:19 +0800
Message-ID: <373FBEBF.C09E99B@krasnet.ru> (raw)
References: <000a01bea00d$443b2b60$2801007e@cadzone.tpf.co.jp>

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? The real problem is
that heap/index_open open file _before_ acquiring any locks and
doesn't check t_xmax of relation/index tuple. I believe that
this is old problem. There are another ones, sure. 
Catalog cache code must be re-designed.

Vadim



view thread (3+ messages)  latest in thread

Message-ID: <373FBEBF.C09E99B@krasnet.ru>
Permalink:  ../373FBEBF.C09E99B@krasnet.ru/
Also on:    postgresql.org/message-id/373FBEBF.C09E99B@krasnet.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: vadim@krasnet.ru, Inoue@tpf.co.jp, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] DROP TABLE does not drop a table completely
  In-Reply-To: <373FBEBF.C09E99B@krasnet.ru>
  References: <000a01bea00d$443b2b60$2801007e@cadzone.tpf.co.jp> <373FBEBF.C09E99B@krasnet.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox