Re: Rollback in Postgres - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: Rollback in Postgres
Date
Msg-id dcc563d10807111021k7e53b36avd0021259b7159558@mail.gmail.com
Whole thread Raw
In response to Rollback in Postgres  ("samantha mahindrakar" <sam.mahindrakar@gmail.com>)
Responses Re: Rollback in Postgres  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-sql
On Fri, Jul 11, 2008 at 9:43 AM, samantha mahindrakar
<sam.mahindrakar@gmail.com> wrote:
> Hi all....
> This is a very basic question.....can we roll back data after we run a
> query.
> I know that a delete within a transaction can be rolled back. But how about
> independent delete queries???
> If i ran a delete statement and lost data...how do i recover. I know that
> oracle has this provision of rollingback queries.
> Iam surprised iam not able to find the same in postgres.

If you were not in a query, then you cannot just roll back.  This is
because each statement is an individual transaction and a delete query
"outside" a transaction is actually a begin;delete...;commit; in
nature.

Oracle only supports the rollback after commit if you have the right
module installed and activated. And it uses up a fair bit of disk
space to do it.  TANSTAAFL.

IF you have PITR setup in postgresql then you can recover to a
previous point in time.  Otherwise, you need to restore from backups.


pgsql-sql by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: When was my database created
Next
From: daniel blanco
Date:
Subject: function that returns a set of records and integer(both of them)‏