X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id C498E9DCBD4 for ; Wed, 21 Dec 2005 10:19:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26814-01 for ; Wed, 21 Dec 2005 10:20:00 -0400 (AST) Received: from pgfoundry.org (pgfoundry.org [200.46.204.130]) by postgresql.org (Postfix) with ESMTP id 7301F9DCBAB for ; Wed, 21 Dec 2005 10:19:54 -0400 (AST) Received: from localhost (av.hub.org [200.46.204.144]) by pgfoundry.org (Postfix) with ESMTP id A2C4C1125052; Wed, 21 Dec 2005 14:19:59 +0000 (GMT) Received: from pgfoundry.org ([200.46.204.130]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 26813-01; Wed, 21 Dec 2005 10:19:57 -0400 (AST) Received: by pgfoundry.org (Postfix, from userid 80) id 706BC1125010; Wed, 21 Dec 2005 14:19:57 +0000 (GMT) To: noreply@pgfoundry.org From: Subject: =?UTF-8?Q?[_psqlodbc-Bugs-1000498_]_rollback_to_savepoint_in_case_of_error?= Content-type: text/plain; charset=UTF-8 Message-Id: <20051221141957.706BC1125010@pgfoundry.org> Date: Wed, 21 Dec 2005 14:19:57 +0000 (GMT) X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=-0.834 required=5 tests=[ALL_TRUSTED=-1.44, AWL=0.056, NO_REAL_NAME=0.55, SUBJECT_EXCESS_QP=0] X-Spam-Score: -0.834 X-Spam-Level: X-Archive-Number: 200512/293 X-Sequence-Number: 6772 Bugs item #1000498, was opened at 2005-12-21 14:19 You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000498&group_id=1000125 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Tom Zschockelt (toz) Assigned to: Nobody (None) Summary: rollback to savepoint in case of error Initial Comment: the current snapshot driver only supports manual rollback to savepoints if ( and only if ) all previous statements return with success. e.g. My env : win2003 server 8.1.0 postgresql psqlodbc 8.01.0105 CREATE TABLE testtable ( f1 int2 primary key, f2 varchar(10) null); the following snippet works BEGIN INSERT INTO testtable values ( 12, 'hello'); SAVEPOINT SP_INSERT; INSERT INTO testtable values ( 13, 'hello1'); ROLLBACK TO SAVEPOINT SP_INSERT; INSERT INTO testtable values ( 13, 'hello123'); COMMIT; the following snippet don't work BEGIN INSERT INTO testtable values ( 12, 'hello'); SAVEPOINT SP_INSERT; INSERT INTO testtable values ( 12, 'hello1'); <-- auto rollback occurs !!! ROLLBACK TO SAVEPOINT SP_INSERT; INSERT INTO testtable values ( 13, 'hello123'); COMMIT; Why does an error breaks the savepoint environment ? By now I used an application side workaround as I do an select before each insert to check if a certain row already exists in the table. If it exist I try an update on the row. ( but this is a real performance killer ... ) ---------------------------------------------------------------------- You can respond by visiting: http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000498&group_id=1000125