Search Postgresql Archives

Re: Re: can't get UPDATE ... RETURNING ... INTO ... to compile successfully

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bill Moran wrote:

> Is it possible that your UPDATE command is updating multiple rows?  I
> don't believe RETURNING will work on an UPDATE that touches more than 1
> row.

Hmm, why not?

alvherre=> create table bill (a int, b text);
CREATE TABLE
alvherre=> insert into bill values (1, 'one');
INSERT 0 1
alvherre=> insert into bill values (2, 'two');
INSERT 0 1
alvherre=> update bill set b = a || ' ' || b returning b;
   b   
-------
 1 one
 2 two
(2 lignes)

UPDATE 2


-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux