Re: "Pretend" update

Поиск
Список
Период
Сортировка
От Victor Yegorov
Тема Re: "Pretend" update
Дата
Msg-id CAGnEbojJGZ4uFboowVLdN7Xv2ddqZqAUNgajHnV5JrU4-7iXiA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: "Pretend" update  (Perry Smith <pedzsan@gmail.com>)
Список pgsql-general
2013/10/1 Perry Smith <pedzsan@gmail.com>

On Oct 1, 2013, at 12:23 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:

> Assuming you are not doing this in a function, you can. Do UPDATE, then SELECT to see your changes or not and then ROLLBACK.

Ah... yes.  I forgot you can see the changes within the same transaction.  Dohhh...

It is possible to use RETURNING clause of the UPDATE statement and avoid SELECT.

And yes, it is necessary to do this within a transaction and roll it back after.

--
Victor Y. Yegorov

В списке pgsql-general по дате отправления:

Предыдущее
От: Perry Smith
Дата:
Сообщение: Re: "Pretend" update
Следующее
От: akp geek
Дата:
Сообщение: Re: Postgres replication question :- One master 2 slaves 9.0.10