Re: Perl and AutoCommit - Mailing list pgsql-general

From Yanni Chiu
Subject Re: Perl and AutoCommit
Date
Msg-id 42464DE3.C6493026@rogers.com
Whole thread Raw
In response to Perl and AutoCommit  (Madison Kelly <linux@alteeve.com>)
List 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

pgsql-general by date:

Previous
From: "Sim Zacks"
Date:
Subject: Re: Good Books
Next
From: Madison Kelly
Date:
Subject: Re: Perl and AutoCommit