DROP TABLE does not drop a table completely

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "pgsql-hackers" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: DROP TABLE does not drop a table completely
Date: 1999-05-17 02:30:45
Message-ID: 000a01bea00d$443b2b60$2801007e@cadzone.tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Hi all,
This mail is about the original cause of [HACKERS] spinlock freeze ?(Re:
INSERT/UPDATE waiting (another example)).

> -----Original Message-----
> From: owner-pgsql-hackers(at)postgreSQL(dot)org
> [mailto:owner-pgsql-hackers(at)postgreSQL(dot)org]On Behalf Of Hiroshi Inoue
> Sent: Thursday, May 13, 1999 7:29 PM
> To: Tom Lane; Wayne Piekarski
> Cc: pgsql-hackers(at)postgreSQL(dot)org
> Subject: [HACKERS] spinlock freeze ?(Re: INSERT/UPDATE waiting (another
> example))
>
>

[snip]

> >
> > Then another one after restarting everything:
> >
> > 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.

Comments ?

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Sauer 1999-05-17 02:35:14 BUG report: ERROR: Cannot expand tables; ....
Previous Message Bruce Momjian 1999-05-17 01:17:30 Re: [HACKERS] GEQO optimizer (was Re: Backend message type 0x44 arrived while idle)

Browse pgsql-sql by date

  From Date Subject
Next Message Vadim Mikheev 1999-05-17 07:01:19 Re: [HACKERS] DROP TABLE does not drop a table completely
Previous Message Engard Ferenc 1999-05-16 20:42:16 offtopic: db-processing speedup in C