Re: Yet another "drop table vs delete" question

From: Christophe <xof(at)thebuild(dot)com>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Yet another "drop table vs delete" question
Date: 2009-04-21 20:59:17
Message-ID: CC06391F-DE2B-423A-A724-25529D045C32@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Apr 21, 2009, at 1:36 PM, Tom Lane wrote:
> I was thinking of MVCC semantics, which is a different issue.

Indeed so, my error. This is a bit of a drift off-topic, but
rereading the docs, I'm now having trouble visualizing the real-world
effect of the non-MVCC-safeness of TRUNCATE. A transaction that
queries the table before the TRUNCATE is going to pick up an ACCESS
SHARED lock, which will prevent the TRUNCATE from running until it's
released. The TRUNCATE will pick up an ACCESS EXCLUSIVE lock that
will block any subsequent queries until the transaction doing the
TRUNCATE commits. I'm sure there is a scenario under which a separate
transaction could see non-MVCC behavior from TRUNCATE, but I'm having
trouble see what it is.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Davis 2009-04-21 21:15:10 Re: Yet another "drop table vs delete" question
Previous Message Tom Lane 2009-04-21 20:36:21 Re: Yet another "drop table vs delete" question