Skip site navigation (1) Skip section navigation (2)

Re: Database Integrity

From: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Database Integrity
Date: 2011-11-18 19:44:33
Message-ID: 20111118204433.143cddd1@anubis.defcon1 (view raw or flat)
Thread:
Lists: pgsql-novice
On Fri, 18 Nov 2011 13:32:03 -0600
JORGE MALDONADO <jorgemal1960(at)gmail(dot)com> 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?

AFAIK no because even if you're not in your transaction, Pg opens its own (hence
rollback if something bad happens).

-- 
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.

In response to

Responses

pgsql-novice by date

Next:From: Daniel StaalDate: 2011-11-18 19:46:48
Subject: Re: Database Integrity
Previous:From: Ramy Abdel-AzimDate: 2011-11-18 19:34:36
Subject: Re: Database Integrity

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group