> 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
On Mon, Nov 28, 2022 at 9:18 AM Ron wrote:
> On 11/28/22 07:29, Arlo Louis O'Keeffe wrote:
> > 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
> >
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 rephrasing as [...]
> I'm not the original poster, but I do use
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 rephrasing as
>
> WITH target_rows AS MATERIALIZED (
> SELECT id
> FROM
"David G. Johnston" writes:
> There is a nice big caution regarding the default read committed isolation
> mode, order by, and for update, in the documentation, but I cannot work out
> exactly why this example seems to be triggering it.
The is talking about a rather different scenario.
I
On Mon, Nov 28, 2022 at 7:18 AM Ron wrote:
> On 11/28/22 07:29, Arlo Louis O'Keeffe wrote:
> > 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
> >
On 11/28/22 07:29, Arlo Louis O'Keeffe wrote:
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
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