Re: [HACKERS] DELETE and UPDATE with LIMIT and ORDER BY - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: [HACKERS] DELETE and UPDATE with LIMIT and ORDER BY
Date
Msg-id CAMkU=1znKFeTv_DgbMOt2gyGe8p7Js7Qcg4Gb16naFHZeD1H9Q@mail.gmail.com
Whole thread Raw
In response to [HACKERS] DELETE and UPDATE with LIMIT and ORDER BY  (Surafel Temesgen <surafel3000@gmail.com>)
Responses Re: [HACKERS] DELETE and UPDATE with LIMIT and ORDER BY  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
List pgsql-hackers
On Mon, Apr 24, 2017 at 8:09 AM, Surafel Temesgen <surafel3000@gmail.com> wrote:
the necessity of allowing limit and order by clause to be used with delete and 
update statement is discussed in the past and added to the todo list 

preveouse mailing list descissions
 

See this more recent one:


That patch was not adopted, as I recall, mostly due to the requirement that it support partitioned tables.
 
i attached a small patch for its implementation.

Notice : inorder to avoid unpredictable result the patch did not allow limit clause without order by and vise versal.

I think both of those are ill-advised.  To avoid deadlock, it is perfectly fine to want an order by without a limit.

And to facilitate the reorganization of partitions or the population of new columns in bite-size chunks, it is also fine to want limit without order by.

Cheers,

Jeff

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] to-do item for explain analyze of hash aggregates?
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Unportable implementation of background worker start