Re: Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really necessary?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Florian G(dot) Pflug" <fgp(at)phlo(dot)org>
Cc: Postgresql-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really necessary?
Date: 2006-03-07 01:28:25
Message-ID: 6032.1141694905@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Florian G. Pflug" <fgp(at)phlo(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Florian G. Pflug 2006-03-07 01:52:44 Re: Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really
Previous Message Florian G. Pflug 2006-03-07 00:54:01 Is the "ACCESS EXCLUSIVE" lock for TRUNCATE really necessary?