Re: autocommit and transactions - Mailing list pgsql-general

From gnari
Subject Re: autocommit and transactions
Date
Msg-id 001e01c4d7d7$8d213240$0100000a@wp2000
Whole thread Raw
In response to autocommit and transactions  ("Sally Sally" <dedeb17@hotmail.com>)
List pgsql-general
From: "Sally Sally" <dedeb17@hotmail.com>


> Using perl DBI I recently read that if autocommit is turned on, it does a
> commit after every transaction. I wanted to confirm if this also applies
to
> select statements.

in fact, it wraps every statement that is not aleady in a transaction,
into one.

> When I'm loading data, I need to do a select before inserting a new row
and
> I don't want to commit after the select because it's unnecessary. So I am
> thinking of turning off the autocommit. Any thoughts?

$dbh->begin_work;
<your statements here>
...
$dbh->commit;


gnari




pgsql-general by date:

Previous
From: Scott Frankel
Date:
Subject: Re: data integrity and inserts
Next
From: Joachim Zobel
Date:
Subject: createlang plperl fails with 8.0 beta5