Skip site navigation (1) Skip section navigation (2)

Transactions and SavePoints

From: Cleber Nardelli <clebernardelli(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Transactions and SavePoints
Date: 2005-08-30 20:24:00
Message-ID: f90442ed050830132479d634b1@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-odbc
Hello.
I am using the Driver odbc for access to postgresql.  
I have a referring problem to the cancellation of the transaction when
some error
is found at the moment of the execution of the same one.  
I try to execute this sql command:  

BEGIN TRANSACTION;
  DELETE FROM TABL1 WHERE ID = 1;
  INSERT INTO TABL1 VALUES (1,1);
  SAVEPOINT SVPT;
  INSERT INTO TABL1 VALUES (1,1);
  ROLLBACK TO SAVEPOINT SPVT;
COMMIT;

When I try to insert as register it accuses to error with key duplicate.  Ok.  
But I do not want to cancel the transaction I I need to only continue
with the same one skirting this error.  For this reason I am using
SavePoints but it generates the error:
"ERROR: ROLLBACK TO SAVEPOINT may only be used in transaction blocks"

Necessary of the your help.  
I thank 

Yours truly

-- 
Cleber Nardelli

pgsql-odbc by date

Next:From: Robin WeberDate: 2005-08-30 20:35:33
Subject: PgSQL odbc driver info
Previous:From: Bruno Wolff IIIDate: 2005-08-30 18:57:59
Subject: Re: New PGSQL and Linux Setup on Old Box

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group