X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 21384D1B97C for ; Wed, 27 Aug 2003 09:30:14 -0300 (ADT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 85573-05 for ; Wed, 27 Aug 2003 09:30:05 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 6F78BD1BA15 for ; Wed, 27 Aug 2003 09:30:01 -0300 (ADT) Received: (qmail 25127 invoked by uid 500); 27 Aug 2003 12:36:01 -0000 Date: Wed, 27 Aug 2003 07:36:01 -0500 From: Bruno Wolff III To: CoL Cc: pgsql-sql@postgresql.org Subject: Re: Restore deleted records Message-ID: <20030827123601.GB25066@wolff.to> Mail-Followup-To: CoL , pgsql-sql@postgresql.org References: <004f01c36bb5$9a962690$f801010a@esir.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/329 X-Sequence-Number: 14945 > Konstantin Petrenko wrote, On 8/26/2003 11:37 AM: > > >Hello. > > > >I accidentally deleted some recordes from my table. How can I restore > >them? Is it possible in 7.3.3? > if you have a dump, or you are still in a transaction, you can rollback. I avoided responding earlier, hoping you could get some more detailed help. Besides recovering from backup (or not committing the transaction if by some chance you haven't already) you can probably get back data from the deleted rows if you haven't run a vacuum since committing the delete. I don't know the specifics of how to do this, but the initial step will be to shut the database cluster down and make a copy of it before running vacuum. Once vacuum has been run, the old tuples will start being written over and you won't have a reliable way to recover the data. If you have alrerady done a vacuum full, you probably won't be able to much of anything back.