Re: How to test something using ROLLBACK TRANSACTION

From: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
To: "William Garrison" <postgres(at)mobydisk(dot)com>
Cc: "Postgres General List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to test something using ROLLBACK TRANSACTION
Date: 2008-09-04 19:28:43
Message-ID: dcc563d10809041228h49f2af15j37b310fcc6092bb0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Sep 4, 2008 at 1:17 PM, William Garrison <postgres(at)mobydisk(dot)com> wrote:
> Coming from MS SQL server, if I ever change anything vital on a production
> system, or do any kind of major hackery on my own, I wrap it in a
> transaction first:
>
> BEGIN TRANSACTION;
> DELETE FROM vital_information WHERE primary_key = 10;
> ROLLBACK TRANSACTION;
>
> I then make sure that the result comes back and says
> 1 row(s) modified
> or something equally reassuring. I have horror stories where DBAs
> fat-fingered something and deleted data. But when I do this in pgadmin3, I
> get a dissatisfying result:

Have you tried psql? That's all I usually use. Here's what I get
from inside psql:

smarlowe=# begin;
BEGIN
smarlowe=# delete from test where i between 4 and 6;
DELETE 3
smarlowe=# rollback;
ROLLBACK

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma 2008-09-04 20:43:32 Re: How to test something using ROLLBACK TRANSACTION
Previous Message William Garrison 2008-09-04 19:17:02 How to test something using ROLLBACK TRANSACTION