Re: Actual row order in UPDATE and SELECT FOR UPDATE

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Nikolai Zhubr <n-a-zhubr(at)yandex(dot)ru>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Actual row order in UPDATE and SELECT FOR UPDATE
Date: 2016-02-15 23:20:10
Message-ID: CAKFQuwZktqAJt7sjYS170ZociDB+UKbU3hdU17EP+N5PCGBdPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 15, 2016 at 3:17 PM, Nikolai Zhubr <n-a-zhubr(at)yandex(dot)ru> wrote:

> Hello all,
>
> I can't find any clear description of how to reliably figure and/or
> enforce specific row (locking) order within UPDATE and SELECT FOR UPDATE
> statements dealing with multiple rows.

​SQL is a set-oriented language. Sets do not have order. Therefore I
don't understand your goal. That said subqueries and ORDER BY may be
solution.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vitaly Burovoy 2016-02-15 23:41:18 Re: Actual row order in UPDATE and SELECT FOR UPDATE
Previous Message Adrian Klaver 2016-02-15 22:27:09 Re: Actual row order in UPDATE and SELECT FOR UPDATE