Re: DBLink cursors - Mailing list pgsql-hackers

From Joe Conway
Subject Re: DBLink cursors
Date
Msg-id 3E9E0F46.3030904@joeconway.com
Whole thread Raw
In response to Re: DBLink cursors  (Kevin Brown <kevin@sysexperts.com>)
Responses Re: DBLink cursors  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
Kevin Brown wrote:
> Won't dblink's attempt to initiate a transaction simply return with a
> warning if a transaction is already in progress?  This is what psql
> does, and it's also what happens with Perl DBI, so it's only if dblink
> freaks out that there will be a problem.
> 
> I wouldn't expect it to abort the entire (already running)
> transaction upon receipt of a warning...
> 
> 
 It's been a while since I even looked at that code very closely, so I 
took it for granted that Shridhar had tried it and it failed. But I 
guess not; you're right (works on 7.3.2 and 7.4devel):

regression=# begin;
BEGIN
regression=# SELECT dblink_open('rmt_foo_cursor','SELECT * FROM foo'); dblink_open
------------- OK
(1 row)

regression=# SELECT *
regression-# FROM dblink_fetch('rmt_foo_cursor',4) AS t(a int, b text, c 
text[]); a | b |     c
---+---+------------ 0 | a | {a0,b0,c0} 1 | b | {a1,b1,c1} 2 | c | {a2,b2,c2} 3 | d | {a3,b3,c3}
(4 rows)

regression=# SELECT dblink_close('rmt_foo_cursor'); dblink_close
-------------- OK
(1 row)

regression=# commit;
COMMIT

Joe



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: One more question regarding dblink
Next
From: Joe Conway
Date:
Subject: Re: DBLink cursors