From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lukáš Sobotka <sobotka.luk@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Trouble with postgres_fdw & dblink extensions
Date: Thu, 15 Nov 2018 18:45:21 -0500
Message-ID: <3232.1542325521@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJif3kL6tKJG+JS3N2oBiwOB7Nxa8a9yKvo6uLe30UYQuHKKDQ@mail.gmail.com>
References: <CAJif3kL6tKJG+JS3N2oBiwOB7Nxa8a9yKvo6uLe30UYQuHKKDQ@mail.gmail.com>
=?UTF-8?B?THVrw6HFoSBTb2JvdGth?= <sobotka.luk@gmail.com> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, sobotka.luk@gmail.com
Subject: Re: Trouble with postgres_fdw & dblink extensions
In-Reply-To: <3232.1542325521@sss.pgh.pa.us>
References: <CAJif3kL6tKJG+JS3N2oBiwOB7Nxa8a9yKvo6uLe30UYQuHKKDQ@mail.gmail.com> <3232.1542325521@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox