Re: update with from

From: Sim Zacks <sim(at)compulab(dot)co(dot)il>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: update with from
Date: 2012-01-23 15:21:24
Message-ID: 4F1D7AF4.8090604@compulab.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/23/2012 04:34 PM, Alban Hertroys wrote:
> On 23 January 2012 14:48, Sim Zacks <sim(at)compulab(dot)co(dot)il> wrote:
>>> In my tests, if the joined rows are sorted it always updates with the
>>> first row. Does anyone have any other experiences, or should I be
>>> concerned that at some point it will behave differently?
>>
>> I checked my tests again. It always uses the last one, not the first one.
>>
>> Sim
>
> I expect that your records get updated multiple times too.
>
> Perhaps you can use DISTINCT ON in your from-based UPDATE?
>

The select in the from statement (i.e. update.. from (select...) )
returns 2739 records. It updates 617 records.
When I run the update it returns "617 rows affected"
So I'm guessing it is not multiple updates.

Sim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2012-01-23 15:29:01 Re: Is Synchronous Postgresql Replication Slower Than Asynchronous?
Previous Message Adrian Klaver 2012-01-23 15:13:10 Re: update with from