Lines 509-512 of contrib/dblink/expected/dblink.out read:

-- this should fail because there is no open transaction
SELECT dblink_exec('myconn','DECLARE xact_test CURSOR FOR SELECT * FROM foo');
ERROR:  sql error
DETAIL:  ERROR:  cursor "xact_test" already exists

The error message is not consistent with what the comment claims.
Looking at the test case in total, I think the code is responding
correctly given the rules stated in your last commit message:

2005-10-17 22:55  joe

        * contrib/dblink/: dblink.c, expected/dblink.out, sql/dblink.sql:
        When a cursor is opened using dblink_open, only start a transaction
        if there isn't one already open. Upon dblink_close, only commit the
        open transaction if it was started by dblink_open, and only then
        when all cursors opened by dblink_open are closed. The transaction
        accounting is done individually for all named connections, plus the
        persistent unnamed connection.

However, this comment is wrong and so is the preceding one, and I think
maybe you want to alter the test case so it does actually exercise
closing the transaction completely.

BTW, I was led to notice this while examining the current buildfarm
failure report from osprey,
http://www.pgbuildfarm.org/cgi-bin/show_log.pl?nm=osprey&dt=2006-06-17%2004:00:16
It looks to me like the diffs are consistent with the idea that the test
is using a copy of dblink that predates this patch ... do you agree?
If so, anyone have an idea how that could happen?  I thought we'd fixed
all the rpath problems, and anyway osprey wasn't failing like this
before today.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to