Re: [HACKERS] DROP TABLE inside transaction block

From: Vadim Mikheev <vadim(at)krs(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] DROP TABLE inside transaction block
Date: 1999-09-07 03:09:40
Message-ID: 37D481F4.4A9FA60B@krs.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
> "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> writes:
> >> That's a good point --- we acquire exclusive lock anyway on a table
> >> about to be deleted, so just holding that lock till end of transaction
> >> should prevent other backends from trying to touch the table.
>
> > That reminds me.
> > DROP TABLE doesn't hold exlusive lock till end of transaction.
> > UnlockRelation() seems too early.
>
> I wondered about that too --- but I didn't change it because I wasn't
> sure it was wrong. Vadim, what do you think?

I remember that Hiroshi reported about this already and
seems we decided to remove UnlockRelation from heap_destroy_with_catalog(),
but forgot to do it?

>
> > Seems ALTER TABLE doesn't acquire any lock for the target
> > relation. It's OK ?
>
> None? Yipes. Seems to me it should *definitely* be grabbing
> AccessExclusiveLock.

Yes.

Vadim

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 1999-09-07 03:19:24 Re: [HACKERS] DROP TABLE inside transaction block
Previous Message Tom Lane 1999-09-07 03:00:55 Re: [HACKERS] DROP TABLE inside transaction block