pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sabin Coanda <s.coanda@deuromedia.ro>
To: pgsql-sql@postgresql.org
Subject: how control update rows
Date: Thu, 3 Feb 2011 13:01:21 +0200
Message-ID: <iie22c$1t3u$1@news.hub.org> (raw)

Hi there,

I'd like to control the rows which are updated. I found useful the option 
RETURNING in UPDATE syntaxt. Can I process the rows wich are returning there 
?

I think to something like that:

SELECT *
FROM (
    UPDATE "T" SET
        "C" = 1
    WHERE "ID" > 100
    RETURNING *
) x

TIA,
Sabin 





view thread (2+ messages)  latest in thread

Message-ID: <iie22c$1t3u$1@news.hub.org>
Permalink:  ../iie22c$1t3u$1@news.hub.org/
Also on:    postgresql.org/message-id/iie22c$1t3u$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: s.coanda@deuromedia.ro
  Subject: Re: how control update rows
  In-Reply-To: <iie22c$1t3u$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox