Re: Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really necessary? - Mailing list pgsql-general

From Tom Lane
Subject Re: Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really necessary?
Date
Msg-id 6032.1141694905@sss.pgh.pa.us
Whole thread Raw
In response to Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really necessary?  ("Florian G. Pflug" <fgp@phlo.org>)
List pgsql-general
"Florian G. Pflug" <fgp@phlo.org> writes:
> Now, I was thinking if TRUNCATE couldn't just let relfilenode in
> pg_class point to a new datafile, and leave the old one in place.

Until when?  How would you synchronize the switchover?

> VACUUM could then remove datafiles when it purges a record from pg_class.

And how would you prevent VACUUM from doing so incorrectly?  The fact
that pg_class contains a dead record is not ordinarily an indication
that the relfilenode mentioned in the record is not needed anymore.

            regards, tom lane

pgsql-general by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really
Next
From: Chris
Date:
Subject: Re: Question about the contrib rpm ?