Re: [COMMITTERS] recover deleted records

Lists: pgsql-committerspgsql-general
From: Allan Morris Caras <amscaras(at)yahoo(dot)com>
To: pgsql-committers(at)postgresql(dot)org
Subject: recover deleted records
Date: 2009-11-24 10:03:22
Message-ID: 753172.36807.qm@web110508.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

I have accidentally / stupidly deleted records from a table.

I tried delete from where exist and it deleted the whole table.

Is there a way I can recover it?

I'm using postgres 8.4

Any help is appreciated. TIA


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] recover deleted records
Date: 2009-11-24 10:14:22
Message-ID: 162867790911240214h79a01c2atc8cd3c59c9e3c353@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

Hello

Have you enabled autovacuum?

Pavel

p.s. please, don't use pgsql-commiters mailing list for general questions.

use pgsql-general.

2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
> I have accidentally / stupidly deleted records from a table.
>
> I tried delete from where exist and it deleted the whole table.
>
> Is there a way I can recover it?
>
> I'm using postgres 8.4
>
> Any help is appreciated. TIA
>
>
>
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>


From: Allan Morris Caras <amscaras(at)yahoo(dot)com>
To: pavel(dot)stehule(at)gmail(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [COMMITTERS] recover deleted records
Date: 2009-11-24 10:16:07
Message-ID: 396178.91545.qm@web110510.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

Hi,

No, auto vacuum is not enabled.

----- Original Message ----
From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Sent: Tue, November 24, 2009 6:14:22 PM
Subject: Re: [COMMITTERS] recover deleted records

Hello

Have you enabled autovacuum?

Pavel

p.s. please, don't use pgsql-commiters mailing list for general questions.

use pgsql-general.

2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
> I have accidentally / stupidly deleted records from a table.
>
> I tried delete from where exist and it deleted the whole table.
>
> Is there a way I can recover it?
>
> I'm using postgres 8.4
>
> Any help is appreciated. TIA
>
>
>
>
>
> --
> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-committers
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [COMMITTERS] recover deleted records
Date: 2009-11-24 10:31:17
Message-ID: 162867790911240231v5313c685jb747dc874700087f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
> Hi,
>
> No, auto vacuum is not enabled.

ok then don't try to call vacuum in any form. so some undelete is
possible. It was good new. Bad new - nobody wrote any tool for it.
There are pgfsck, but itsn't three years actualised - but you can try
it.

look on http://svana.org/kleptog/pgsql/pgfsck.html

good luck
Pavel Stehule

>
>
>
>
>
> ----- Original Message ----
> From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
> Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
> Sent: Tue, November 24, 2009 6:14:22 PM
> Subject: Re: [COMMITTERS] recover deleted records
>
> Hello
>
> Have you enabled autovacuum?
>
> Pavel
>
> p.s. please, don't use pgsql-commiters mailing list for general questions.
>
> use pgsql-general.
>
> 2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
>> I have accidentally / stupidly deleted records from a table.
>>
>> I tried delete from where exist and it deleted the whole table.
>>
>> Is there a way I can recover it?
>>
>> I'm using postgres 8.4
>>
>> Any help is appreciated. TIA
>>
>>
>>
>>
>>
>> --
>> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-committers
>>
>
>
>
>
>


From: Allan Morris Caras <amscaras(at)yahoo(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [COMMITTERS] recover deleted records
Date: 2009-11-24 11:12:51
Message-ID: 117528.19299.qm@web110510.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

Hi,

I tried to test it but it says couldn't find class 'pg_attribute'

When I tried looking into the table that deleted records from, it didn't revert back what I've deleted.

Any clues?

----- Original Message ----
From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Sent: Tue, November 24, 2009 6:31:17 PM
Subject: Re: [COMMITTERS] recover deleted records

2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
> Hi,
>
> No, auto vacuum is not enabled.

ok then don't try to call vacuum in any form. so some undelete is
possible. It was good new. Bad new - nobody wrote any tool for it.
There are pgfsck, but itsn't three years actualised - but you can try
it.

look on http://svana.org/kleptog/pgsql/pgfsck.html

good luck
Pavel Stehule

>
>
>
>
>
> ----- Original Message ----
> From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
> Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
> Sent: Tue, November 24, 2009 6:14:22 PM
> Subject: Re: [COMMITTERS] recover deleted records
>
> Hello
>
> Have you enabled autovacuum?
>
> Pavel
>
> p.s. please, don't use pgsql-commiters mailing list for general questions.
>
> use pgsql-general.
>
> 2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
>> I have accidentally / stupidly deleted records from a table.
>>
>> I tried delete from where exist and it deleted the whole table.
>>
>> Is there a way I can recover it?
>>
>> I'm using postgres 8.4
>>
>> Any help is appreciated. TIA
>>
>>
>>
>>
>>
>> --
>> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-committers
>>
>
>
>
>
>


From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [COMMITTERS] recover deleted records
Date: 2009-11-24 12:14:25
Message-ID: 162867790911240414s22817df8gc5bce2133af9b54d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
> Hi,
>
> I tried to test it but it says couldn't find class 'pg_attribute'

It is strange - but this software isn't maintained long time, and it's
not actual.

so it is a bad

Pavel

>
> When I tried looking into the table that deleted records from, it didn't revert back what I've deleted.
>
> Any clues?
>
>
>
>
>
> ----- Original Message ----
> From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
> Cc: pgsql-general(at)postgresql(dot)org
> Sent: Tue, November 24, 2009 6:31:17 PM
> Subject: Re: [COMMITTERS] recover deleted records
>
> 2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
>> Hi,
>>
>> No, auto vacuum is not enabled.
>
> ok then don't try to call vacuum in any form. so some undelete is
> possible. It was good new. Bad new - nobody wrote any tool for it.
> There are pgfsck, but itsn't three years actualised - but you can try
> it.
>
> look on http://svana.org/kleptog/pgsql/pgfsck.html
>
> good luck
> Pavel Stehule
>
>
>
>>
>>
>>
>>
>>
>> ----- Original Message ----
>> From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
>> To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
>> Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
>> Sent: Tue, November 24, 2009 6:14:22 PM
>> Subject: Re: [COMMITTERS] recover deleted records
>>
>> Hello
>>
>> Have you enabled autovacuum?
>>
>> Pavel
>>
>> p.s. please, don't use pgsql-commiters mailing list for general questions.
>>
>> use pgsql-general.
>>
>> 2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
>>> I have accidentally / stupidly deleted records from a table.
>>>
>>> I tried delete from where exist and it deleted the whole table.
>>>
>>> Is there a way I can recover it?
>>>
>>> I'm using postgres 8.4
>>>
>>> Any help is appreciated. TIA
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Sent via pgsql-committers mailing list (pgsql-committers(at)postgresql(dot)org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-committers
>>>
>>
>>
>>
>>
>>
>
>
>
>
>


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Allan Morris Caras <amscaras(at)yahoo(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: recover deleted records
Date: 2009-11-24 15:14:09
Message-ID: 603c8f070911240714k14cd5fc6l97c91be29dcbd7e0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

On Tue, Nov 24, 2009 at 5:03 AM, Allan Morris Caras <amscaras(at)yahoo(dot)com> wrote:
> I have accidentally / stupidly deleted records from a table.
>
> I tried delete from where exist and it deleted the whole table.
>
> Is there a way I can recover it?
>
> I'm using postgres 8.4
>
> Any help is appreciated. TIA

I think you're going to need to restore from backup.

Incidentally, this is the wrong place for asking questions of this
type. You should try pgsql-general.

...Robert


From: Scott Bailey <artacus(at)comcast(dot)net>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [COMMITTERS] recover deleted records
Date: 2009-11-24 19:26:17
Message-ID: 4B0C3359.2050505@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-committers pgsql-general

Pavel Stehule wrote:
> 2009/11/24 Allan Morris Caras <amscaras(at)yahoo(dot)com>:
>> Hi,
>>
>> I tried to test it but it says couldn't find class 'pg_attribute'
>
> It is strange - but this software isn't maintained long time, and it's
> not actual.
>
> so it is a bad
>
> Pavel
>
>> When I tried looking into the table that deleted records from, it didn't revert back what I've deleted.
>>
>> Any clues?

Easiest is to restore from backup ;)

It would be cool if there was an XID override function. If you could for
instance say "run this query, but I want you to use the XID immediately
before the one that wiped out my table," then you could see all of those
deleted rows. To my knowledge, no such functionality exists, but it
might not be that hard.

And if you were really brave, you could copy the binary file for that
table and walk it removing the xmax values that matched the offending
transaction. There may be problems with the freespace map or other
issues that I'm not aware of, but I'd probably at least try it if I was
going to lose my job or the company lose mega $ over it.

Scott Bailey