Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ekDUB-0002aT-Mf for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Feb 2018 18:33:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekDUA-0005Xh-IR for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Feb 2018 18:33:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ekDUA-0005XX-BK for pgsql-hackers@lists.postgresql.org; Fri, 09 Feb 2018 18:33:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ekDU5-0007br-VA for pgsql-hackers@postgresql.org; Fri, 09 Feb 2018 18:33:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w19IX8w1020135; Fri, 9 Feb 2018 13:33:08 -0500 From: Tom Lane To: Robert Haas cc: Etsuro Fujita , Pg Hackers , Rushabh Lathia , Michael Paquier , Ashutosh Bapat Subject: Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly In-reply-to: References: <5A438A45.2000909@lab.ntt.co.jp> <5A57193A.2080003@lab.ntt.co.jp> <6166.1518044513@sss.pgh.pa.us> <5A7BE8E6.200@lab.ntt.co.jp> <28606.1518105934@sss.pgh.pa.us> <5A7CFDDA.8050906@lab.ntt.co.jp> <5A7D76CF.8080601@lab.ntt.co.jp> Comments: In-reply-to Robert Haas message dated "Fri, 09 Feb 2018 11:50:14 -0500" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <20022.1518201018.0@sss.pgh.pa.us> Date: Fri, 09 Feb 2018 13:33:08 -0500 Message-ID: <20134.1518201188@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20022.1518201018.1@sss.pgh.pa.us> Robert Haas 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 ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="add-sleep.patch"; charset="us-ascii" Content-ID: <20022.1518201018.2@sss.pgh.pa.us> Content-Description: add-sleep.patch Content-Transfer-Encoding: quoted-printable 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 =3D 'bar' WHERE postgres_fdw_abs(c1) > 2000 RETURNING = *; -- can't be pushed down UPDATE ft2 SET c3 =3D 'bar' WHERE postgres_fdw_abs(c1) > 2000 RETURNING = *; + select pg_sleep(60); EXPLAIN (verbose, costs off) UPDATE ft2 SET c3 =3D 'baz' FROM ft4 INNER JOIN ft5 ON (ft4.c1 =3D ft5.c1) ------- =_aaaaaaaaaa0--