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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Bill Moran <wmoran(at)collaborativefusion(dot)com>, Dale <harris_da(at)yahoo(dot)com(dot)au>, pgsql-general(at)postgresql(dot)org
Subject: Re: Re: can't get UPDATE ... RETURNING ... INTO ... to compile successfully
Date: 2008-08-19 15:29:51
Message-ID: 21834.1219159791@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> 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?

plpgsql will reject UPDATE RETURNING INTO that returns more than one
row, since it hasn't got any place to put the additional data.

It wasn't clear to me whether the OP was even using plpgsql, but if he
was, the example should have worked. We'd need to see more detail to
guess what the real problem is.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alan Hodgson 2008-08-19 16:42:07 Re: Updates and deletes with joins
Previous Message Tom Lane 2008-08-19 15:21:58 Re: Idle in transcation problem?