transactions on Postgresql

From: hicham bouzdad <h(dot)bouzdad(at)inovaction(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: transactions on Postgresql
Date: 2001-05-23 09:59:40
Message-ID: 3B0B8A0C.B46AC073@inovaction.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi everybody,

my subject is about : DBI / PostgreSql & Transactions with Perl.
my code is :

$dbh->{AutoCommit} = 0; #-------- begin of transaction
while (<FILE>) {
...
$sql = "insert into $table ($col) values ($val)";
$res = $dbh->do($sql);
}

$dbh->rollback; #--------- end of transaction

my problem : if an insert fail, all following insert are aborted :-(

NB : it's not necessary to me that ALL inserts , will be done
with succes.
my question is : if a BAD insert fail , how can i do for doing
other inserts who may be are GOOD ?

thanks a lot for help ;-)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arve Fahlvik 2001-05-23 10:06:30 Problems with backup
Previous Message Richard Huxton 2001-05-23 08:52:15 Re: incomplete transaction keeps table locked?