Re: Removing unneeded self joins - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Removing unneeded self joins
Date
Msg-id b9e8f460-f9a6-0e9b-e8ba-60d59f0bc22c@gmail.com
Whole thread Raw
In response to Re: Removing unneeded self joins  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: Removing unneeded self joins
List pgsql-hackers
09.01.2024 01:09, Alexander Korotkov wrote:
> Fixed in 30b4955a46.

Thank you for fixing that!

I've found another anomaly coined with d3d55ce57. This query:
CREATE TABLE t(a int PRIMARY KEY, b int);
INSERT INTO t VALUES  (1, 1), (2, 1);

WITH t1 AS (SELECT * FROM t)
UPDATE t SET b = t1.b + 1 FROM t1
WHERE t.a = t1.a RETURNING t.a, t1.b;

gives "ERROR:  variable not found in subplan target lists" on d3d55ce57, but
starting from a7928a57b it gives an incorrect result:
  a | b
---+---
  1 | 2
  2 | 2
(2 rows)


Best regards,
Alexander



pgsql-hackers by date:

Previous
From: Amul Sul
Date:
Subject: Re: introduce dynamic shared memory registry
Next
From: Michael Paquier
Date:
Subject: Re: Adding facility for injection points (or probe points?) for more advanced tests