delete statement returning too many results

2022-11-28 Thread Arlo Louis O'Keeffe
Hello everyone, I am seeing weird behaviour of a delete statement that is returning more results than I am expecting. This is the query: DELETE FROM queue WHERE id IN ( SELECT id FROM queue ORDER BY id LIMIT 1

Re: delete statement returning too many results

2022-12-04 Thread Arlo Louis O'Keeffe
> On 29. Nov 2022, at 18:35, Tom Lane wrote: > > Harmen writes: >> On Mon, Nov 28, 2022 at 12:11:53PM -0500, Tom Lane wrote: >>> So basically it's unsafe to run the sub-select more than once, >>> but the query as written leaves it up to the planner whether >>> to do that. I'd suggest rephrasi