Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNRKH-0007hO-1l for pgsql-general@arkaria.postgresql.org; Thu, 15 Nov 2018 23:45:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gNRKC-0003RL-PK for pgsql-general@arkaria.postgresql.org; Thu, 15 Nov 2018 23:45:28 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNRKC-0003Qp-HD for pgsql-general@lists.postgresql.org; Thu, 15 Nov 2018 23:45:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gNRK8-0000QV-M5 for pgsql-general@postgresql.org; Thu, 15 Nov 2018 23:45:26 +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 wAFNjLvJ003233; Thu, 15 Nov 2018 18:45:21 -0500 From: Tom Lane To: =?UTF-8?B?THVrw6HFoSBTb2JvdGth?= cc: pgsql-general@postgresql.org Subject: Re: Trouble with postgres_fdw & dblink extensions In-reply-to: References: Comments: In-reply-to =?UTF-8?B?THVrw6HFoSBTb2JvdGth?= message dated "Fri, 16 Nov 2018 00:23:41 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3231.1542325521.1@sss.pgh.pa.us> Date: Thu, 15 Nov 2018 18:45:21 -0500 Message-ID: <3232.1542325521@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =?UTF-8?B?THVrw6HFoSBTb2JvdGth?= writes: > I would be grateful for some help. I am writing you because I am confused > about using data foreign wrappers and dblink. I attached simplified script > describing the problem. I think what is happening is that postgres_fdw starts a transaction on its connection as soon as it's asked to do something, and then the CREATE TABLE executed on dblink's separate connection isn't visible to that already-in-progress transaction. That theory only holds up if you are running in serializable mode (which postgres_fdw would then also use for its remote transaction). Which you didn't say, but it's hard to see how it'd fail otherwise. regards, tom lane