Re: PostgreSQL Data Loss

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "BluDes" <DESPAMMAMIdarocchi(at)PERFAVOREtiscali(dot)it>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PostgreSQL Data Loss
Date: 2007-01-27 00:11:59
Message-ID: 87odol8h0w.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"BluDes" <DESPAMMAMIdarocchi(at)PERFAVOREtiscali(dot)it> writes:

> My customer claims that he lost lots of data reguarding his own clients and
> that those data had surely been saved on the database.

Has this Postgres database been running for a long time? There is a regular
job called VACUUM that has to be run on every table periodically to recover
free space.

If this isn't run for a very long time (how long depends on how busy the
database is, but even on extremely large databases it's usually a matter of
months, on more normal databases it would be years) then very old records seem
to suddenly disappear. There is a way to recover data that this has happened
to though as long as you don't run vacuum after the data has disappeared.

To repeat: If you think this may have happened DO NOT run vacuum now.

Do you think this may have happened? How long ago was this database created?
Does your system periodically run VACUUM? Is the missing data in every table
or just a particular table?

Incidentally recent versions of Postgres don't allow this to occur and stop
running with a message insisting you run vacuum before continuing.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2007-01-27 00:12:11 Re: 10 weeks to feature freeze (Pending Work)
Previous Message Gregory Stark 2007-01-27 00:11:32 Re: 10 weeks to feature freeze (Pending Work)