Re: Why database is corrupted after re-booting - Mailing list pgsql-general

From Richard Huxton
Subject Re: Why database is corrupted after re-booting
Date
Msg-id 4360B732.8010405@archonet.com
Whole thread Raw
In response to Re: Why database is corrupted after re-booting  ("Andrus" <eetasoft@online.ee>)
List pgsql-general
Andrus wrote:
> My problem: Sometimes I need also to run desktop (server and client in same
> desktop computer)  applications with Postgres.
> Desktop computer have this config. It is not  possible to force users to buy
> SCSI drives nor upses for each desktop computer.
> Can Firebird or SQLLite automatically recover from power failure?

If data on your disk gets corrupted then NOTHING can guarantee to
recover your database - not PG, not Firebird, not Oracle.

PostgreSQL writes all transactions to a log (WAL) before reporting them
as committed. If your system tells the truth about when data is actually
written to disk, then it can use this WAL to find out what happened when
the system stopped and make sure the database is in a consistent state.

Now, if your WAL gets corrupted then obviously there's not much PG can
do about it - that's why it's vital to make sure that write caching is
off, so PG can guarantee that something written to disk is actually there.

Now, since you're not going to control your clients' hardware, and
probably can't guarantee their settings either you'll have to accept a
greater risk of data loss than with good quality hardware you specify
yourself. There are steps you can take to protect their data though -
running on NTFS, telling them to switch write caching off and, I would
suggest looking into running a PITR setup on the same machine.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Problem with SSL and postgreSQL 8.0.4
Next
From: Richard Huxton
Date:
Subject: Re: missing FROM clause ?