Re: Must be owner to truncate?

Mike Mascari <mascarm@mascari.com>

From: Mike Mascari <mascarm@mascari.com>
To: Stephen Frost <sfrost@snowman.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, andrew@supernews.com, pgsql-hackers@postgresql.org
Date: 2005-07-09T13:47:50Z
Lists: pgsql-hackers
Stephen Frost wrote:

> delete from x;/truncate x;
>   --> Creates a new, empty, file and makes it the 'current' file
>   --> Marks the old file for deletion, but it is kept around for any
>       transactions which were started before the truncate;
>   --> New transactions use the empty file
>   --> Once all transactions using the old file have completed, the old
>       file can be deleted.
>   --> Old transactions which insert rows would need to use the new file
>       or scan the old file for rows which they added, I suppose.

And when the transaction that issued the TRUNCATE aborts after step 3, 
but newer transactions commit?

Mike Mascari