Skip site navigation (1) Skip section navigation (2)

Re: how can i view deleted records?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Steve Atkins <steve(at)blighty(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: how can i view deleted records?
Date: 2006-04-30 10:33:04
Message-ID: 20060430103304.GC11912@svana.org (view raw or flat)
Thread:
Lists: pgsql-general
On Sat, Apr 29, 2006 at 07:05:35PM -0700, Steve Atkins wrote:
> >Just kidding... once you delete your records... they are gone.
> 
> That's.... not true.
> 
> Deleted (or modified) records don't go away until the space
> they use is recycled by the VACUUM command.

Well yes, but with autovacuum you don't know when that might be.

> However, there's no support in postgresql for any sort of
> "time travel", including viewing deleted tuples. The data
> is there on the disk, but there is no clean way to view it
> via the database.

Well, there is a timetravel module which you can enable per table. Just
showing deleted records in general doesn't work well because it
violates all sorts of constraints. If you show deleted records, all of
a sudden your unique indexes arn't unique anymore. Timetravel is
expensive though, which is why it's not by default.

Have a ncie day,
-- 
Martijn van Oosterhout   <kleptog(at)svana(dot)org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

pgsql-general by date

Next:From: Tony LausinDate: 2006-04-30 11:01:36
Subject: Is PostgreSQL an easy choice for a large CMS?
Previous:From: Dan BlackDate: 2006-04-30 05:06:13
Subject: Ответ: how can i view deleted records?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group