Re: TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE

Поиск
Список
Период
Сортировка
От Jaime Casanova
Тема Re: TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE
Дата
Msg-id i2k3073cc9b1004061331w8d78da7em35d4d2185781183e@mail.gmail.com
обсуждение исходный текст
Ответ на TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Rob Richardson"
Дата:
Сообщение: Re: TRANSACTION FOR AN UPDATE COMMAND WITH ONE TABLE
Следующее
От: syan tan
Дата:
Сообщение: Re: slow plan on join when adding where clause