Re: Avoiding a deadlock - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Avoiding a deadlock
Date
Msg-id A737B7A37273E048B164557ADEF4A58B057BDA0A@ntex2010a.host.magwien.gv.at
Whole thread Raw
In response to Re: Avoiding a deadlock  (Paul Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-general
Paul Jungwirth wrote:
>> Out of curiosity: any reason the ORDER BY should be in the subquery? It seems like it ought to be in
> the UPDATE (if that's allowed).
> 
> Hmm, it's not allowed. :-) It's still surprising that you can guarantee the order of a multi-row
> UPDATE by ordering a subquery.

To be honest, I don't think that there is any guarantee for this
to work reliably in all comparable cases, as PostgreSQL does
not guarantee in which order it performs the UPDATEs.

It just happens to work with certain plans (use EXPLAIN
to see wat will happen).

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: Splitting Postgres into Separate Clusters?
Next
From: JotaComm
Date:
Subject: Problems with PostgreSQL Replication (Log Shipping)