Re: "Pretend" update - Mailing list pgsql-general

From Victor Yegorov
Subject Re: "Pretend" update
Date
Msg-id CAGnEbojJGZ4uFboowVLdN7Xv2ddqZqAUNgajHnV5JrU4-7iXiA@mail.gmail.com
Whole thread Raw
In response to Re: "Pretend" update  (Perry Smith <pedzsan@gmail.com>)
List 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 by date:

Previous
From: Perry Smith
Date:
Subject: Re: "Pretend" update
Next
From: akp geek
Date:
Subject: Re: Postgres replication question :- One master 2 slaves 9.0.10