Re: Database Integrity - Mailing list pgsql-novice

From Ramy Abdel-Azim
Subject Re: Database Integrity
Date
Msg-id 4EC6B34C.4070908@startdatelabs.com
Whole thread Raw
In response to Database Integrity  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Responses Re: Database Integrity  ("Daniel Staal" <DStaal@usa.net>)
List 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


pgsql-novice by date:

Previous
From: JORGE MALDONADO
Date:
Subject: Database Integrity
Next
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: Database Integrity