Re: Must be owner to truncate? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Must be owner to truncate?
Date
Msg-id 4907.1120924115@sss.pgh.pa.us
Whole thread Raw
In response to Re: Must be owner to truncate?  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Must be owner to truncate?  ("Jim C. Nasby" <decibel@decibel.org>)
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> * Mike Mascari (mascarm@mascari.com) wrote:
>> And when the transaction that issued the TRUNCATE aborts after step 3,
>> but newer transactions commit?

> The newer transactions would have to check for that situation.

How would they do that?  They might be long gone by the time the
truncating transaction rolls back.

It might be possible to do something that preserves full MVCC-ness for
concurrent readers, but I don't believe there is any choice but to lock
out concurrent writers until the truncate commits.  If you try to allow
that, there's no way to keep straight whose change goes into which file.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: Must be owner to truncate?
Next
From: Joe Conway
Date:
Subject: roles question