Kohei KaiGai wrote:
>> Weird, that fails for me.
> Both of the troubles you reported was fixed with attached patch.
> I also added relevant test cases into regression test, please check it.
It passes the regression tests, and solves the problems I found.
I came up with one more query that causes a problem:
CREATE TABLE test(
id integer PRIMARY KEY,
val text NOT NULL
INSERT INTO test(id, val) VALUES (1, 'one');
CREATE FOREIGN TABLE rtest(
id integer not null,
val text not null
) SERVER loopback OPTIONS (relname 'test');
/* loopback points to the same database */
WITH ch AS (
) UPDATE rtest
WHERE rtest.id = ch.id;
This causes a deadlock, but one that is not detected;
the query just keeps hanging.
The UPDATE in the CTE has the rows locked, so the
SELECT ... FOR UPDATE issued via the FDW connection will hang
I wonder if that's just a pathological corner case that we shouldn't
worry about. Loopback connections for FDWs themselves might not
be so rare, for example as a substitute for autonomous subtransactions.
I guess it is not easily possible to detect such a situation or
to do something reasonable about it.
>> I took a brief look at the documentation; that will need some more
> Yep, I believe it should be revised prior to this patch being committed.
I tried to overhaul the documentation, see the attached patch.
There was one thing that I was not certain of:
You say that for writable foreign tables, BeginForeignModify
and EndForeignModify *must* be implemented.
I thought that these were optional, and if you can do your work
with just, say, ExecForeignDelete, you could do that.
I left that paragraph roughly as it is, please change it if
I also changed the misspelled "resultRelaion" and updated a
May I suggest to split the patch in two parts, one for
all the parts that affect postgres_fdw and one for the rest?
That might make the committer's work easier, since
postgres_fdw is not applied (yet).
In response to
pgsql-hackers by date
|Next:||From: Andres Freund||Date: 2012-12-11 15:43:12|
|Subject: Re: Re: [PATCH 02/14] Add support for a generic wal
reading facility dubbed XLogReader|
|Previous:||From: Tom Lane||Date: 2012-12-11 15:21:47|
|Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL|