Re: TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE - Mailing list pgsql-novice

From Jaime Casanova
Subject Re: TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE
Date
Msg-id i2k3073cc9b1004061331w8d78da7em35d4d2185781183e@mail.gmail.com
Whole thread Raw
In response to TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE  (JORGE MALDONADO <jorgemal1960@gmail.com>)
List pgsql-novice
On Tue, Apr 6, 2010 at 2:23 PM, JORGE MALDONADO <jorgemal1960@gmail.com> wrote:
> I have an UPDATE command which modifies several records of one (only one)
> table.
> Is it feasible (or a good idea) to include it in a transaction block to make
> sure the process is performed with integrity?

PostgreSQL runs everything that is not inside a transaction block
inside it's own implicit transaction (one implicit transaction per
statement).
so

begin;
update ....
commit;

it's the same as:

update ....

and

update table1 ...
update table2 ...

it's the same as:

begin;
update table1 ...
commit;

begin;
update table2 ...
commit;

--
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

pgsql-novice by date:

Previous
From: "Rob Richardson"
Date:
Subject: Re: TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE
Next
From: syan tan
Date:
Subject: Re: slow plan on join when adding where clause