Re: Database Integrity

From: Ramy Abdel-Azim <ramy(dot)abdel-azim(at)startdatelabs(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Database Integrity
Date: 2011-11-18 19:34:36
Message-ID: 4EC6B34C.4070908@startdatelabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

The purpose of using a transaction is so that if you run your delete
statement and realize that you've deleted the wrong rows, you can roll
the transaction back and get those rows back. You can then modify your
query and try again and when you finally get it right, issue a commit
command.

Hope that answers your question.

On 11/18/11 2:32 PM, JORGE MALDONADO wrote:
> I need to delete several records from a table so my query is composed
> of a DELETE command with a condition, something like the following:
>
> DELETE FROM tblTable WHERE field1 = something
>
> Do I need to use a transaction in an operation like this to be sure
> the database remains integral in case of an error?
>
> Respectfully,
> Jorge Maldonado

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jean-Yves F. Barbier 2011-11-18 19:44:33 Re: Database Integrity
Previous Message JORGE MALDONADO 2011-11-18 19:32:03 Database Integrity