Re: "Pretend" update

From: Victor Yegorov <vyegorov(at)gmail(dot)com>
To: Perry Smith <pedzsan(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: "Pretend" update
Date: 2013-10-01 18:38:25
Message-ID: CAGnEbojJGZ4uFboowVLdN7Xv2ddqZqAUNgajHnV5JrU4-7iXiA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2013/10/1 Perry Smith <pedzsan(at)gmail(dot)com>

>
> On Oct 1, 2013, at 12:23 PM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message akp geek 2013-10-01 21:03:41 Re: Postgres replication question :- One master 2 slaves 9.0.10
Previous Message Perry Smith 2013-10-01 18:12:59 Re: "Pretend" update