Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly - Mailing list pgsql-hackers

From Tom Lane
Subject Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly
Date
Msg-id 20134.1518201188@sss.pgh.pa.us
Whole thread Raw
In response to Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> Me neither.  I just ran the postgres_fdw regression tests 713 times in
> a row without a failure.  Tom, since you seem to be able to reproduce
> the problem locally, could you have a look at this proposed fix?

I'm a bit busy, but AFAICS it's just a timing thing, so try inserting
a sleep.  The attached is enough to reproduce rhinoceros' results
for me.

            regards, tom lane

diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql
index 0b2c528..3f8bd6d 100644
*** a/contrib/postgres_fdw/sql/postgres_fdw.sql
--- b/contrib/postgres_fdw/sql/postgres_fdw.sql
*************** INSERT INTO ft2 (c1,c2,c3)
*** 1133,1138 ****
--- 1133,1139 ----
  EXPLAIN (verbose, costs off)
  UPDATE ft2 SET c3 = 'bar' WHERE postgres_fdw_abs(c1) > 2000 RETURNING *;            -- can't be pushed down
  UPDATE ft2 SET c3 = 'bar' WHERE postgres_fdw_abs(c1) > 2000 RETURNING *;
+ select pg_sleep(60);
  EXPLAIN (verbose, costs off)
  UPDATE ft2 SET c3 = 'baz'
    FROM ft4 INNER JOIN ft5 ON (ft4.c1 = ft5.c1)

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly
Next
From: Andres Freund
Date:
Subject: Re: JIT compiling with LLVM v9.0