Re: sql insert function

From: Alex Satrapa <alex(at)lintelsys(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: sql insert function
Date: 2004-01-13 03:53:16
Message-ID: 40036BAC.40700@lintelsys.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Ochs wrote:
> My program starts a transaction, does about 20 inserts, then commits. When
> I replace once of the inserts with a function that does the insert, when I
> do the commit I get this message:
>
> WARNING: there is no transaction in progress
>
> The inserts all commit fine. Do functions used through DBD::Pg do something
> like turn on autocommit after a function is called?

Is your function calling 'commit' itself? If so, it could be committing
before your SQL statement issues the 'commit', thus attempting to commit
a transaction which doesn't exist any more.

DBD::Pg defaults to "AutoCommit" behaviour, unless you explicitly turn
it off:

my $dbh = DBI->connect (
"DBI:Pg:dbname=database", "user" , "password",
{AutoCommit => 0}
);

HTH
Alex Satrapa

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2004-01-13 04:32:15 Re: Postgres + Xapian (was Re: fulltext searching via a
Previous Message D. Dante Lorenso 2004-01-13 02:24:10 Re: Drawbacks of using BYTEA for PK?