On Tue, 2007-07-24 at 09:01 -0700, scoobyjh wrote:
> When VACUUM cleaning a database it creates a temporary file by default in
> /var/tmp. What happens when power is lost or unit crashes? Can the database
> be correupted or lose data?

It's not supposed to be able to.

Essentially, a VACUUM does this:

1) Creates a database in /var/tmp and copies all the data from the
   original database into the temporary db. Because it has just been
   created and populated, there are no free pages and the packing
   of data into the b-tree structures is close to optimal. 

2) Opens a transaction on the original database.

3) Copies the pages one by one from the /var/tmp database back into
   the original database. Before each page is overwritten, it is
   journalled - just like in a regular SQL transaction.

4) Truncates the original database, journaling every page that occurs
   after the truncation point.

5) Commits the transaction on the original database.

So it's no more dangerous than any other database write.

Dan.



> 
> thanks and regards,
> 
> Scooby


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to