Re: pgsql_fdw, FDW for PostgreSQL server

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: "Shigeru Hanada *EXTERN*" <shigeru(dot)hanada(at)gmail(dot)com>, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>, "Kohei KaiGai" <kaigai(at)kaigai(dot)gr(dot)jp>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, "Etsuro Fujita" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>
Subject: Re: pgsql_fdw, FDW for PostgreSQL server
Date: 2012-03-06 10:09:08
Message-ID: D960CB61B694CF459DCFB4B0128514C20794FF42@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shigeru Hanada wrote:
[pgsql_fdw_v12.patch]

I know this is not the latest version, but I played around with it and
tickled a bug.
It seems to have a problem with rolled back subtransactions.

test=> \d+ remote
Foreign table "laurenz.remote"
Column | Type | Modifiers | FDW Options | Storage | Description
--------+---------+-----------+-------------+----------+-------------
id | integer | not null | | plain |
val | text | not null | | extended |
Server: loopback
FDW Options: (nspname 'laurenz', relname 'local')
Has OIDs: no
test=> BEGIN;
test=> DECLARE x CURSOR FOR SELECT * FROM remote;
DEBUG: Remote SQL: SELECT id, val FROM laurenz.local
DEBUG: relid=16423 fetch_count=10000
DEBUG: starting remote transaction with "START TRANSACTION ISOLATION
LEVEL REPEATABLE READ"
test=> FETCH x;
id | val
----+-----
1 | one
(1 row)
test=> SAVEPOINT z;
test=> ERROR OUT;
ERROR: syntax error at or near "ERROR"
LINE 1: ERROR OUT;
test=> ROLLBACK TO SAVEPOINT z;
test=> FETCH x;
id | val
----+-----
2 | two
(1 row)
test=> COMMIT;
ERROR: could not close cursor
DETAIL: no connection to the server

HINT: CLOSE pgsql_fdw_cursor_0

The error message reported is not consistent, at one attempt the backend
crashed.

Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2012-03-06 10:43:57 Re: RFC: Making TRUNCATE more "MVCC-safe"
Previous Message Noah Misch 2012-03-06 09:54:59 Re: RFC: Making TRUNCATE more "MVCC-safe"