Re: Perl and AutoCommit

From: Yanni Chiu <yanni(at)rogers(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Perl and AutoCommit
Date: 2005-03-27 06:08:35
Message-ID: 42464DE3.C6493026@rogers.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Madison Kelly wrote:
>
> What I am trying to do is turn off autocommit for one particular task
> in my program. I realize I can turn off AutoCommit when I connect to the
> database but in this case that is not what I want to do. This is a
> one-off task.
>
> What I thought would work was:
>
> $DB->begin_work() || die...
> # a lot of transactions
> $DB->commit() || die...
>
> But that doesn't seem to be it, either...

The way I read the postgres docs, there is no autocommit.
Every sql command is wrapped in a transaction, unless
you issue a "BEGIN" (or "START TRANSACTION").

What makes you think that the code above did not work?
What Perl library are you using?
What does $DB->begin_work() actually do?
--I'm thinking there could be a $DB->begin_transaction()
You could turn on some trace output in the postgres
server (i.e. postmaster), and observe the sequence
of SQL that is being sent. HTH.

--yanni

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2005-03-27 06:17:17 Re: Good Books
Previous Message Dan Sugalski 2005-03-27 05:59:02 Re: Perl and AutoCommit