From: Michael Meskes <meskes@postgresql.org>
To: Robert Rothe <rrothe@mindspring.com>
Cc: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgresql.org>
Subject: Re: [INTERFACES] Always get TranBlock notice using 'c'
Date: Fri, 24 Dec 1999 10:56:33 +0100
Message-ID: <19991224105633.B357@fam-meskes.de> (raw)
In-Reply-To: <38628B50.FF9F52B7@mindspring.com>
References: <38628B50.FF9F52B7@mindspring.com>
On Thu, Dec 23, 1999 at 03:51:28PM -0500, Robert Rothe wrote:
> When writing apps using 'c' and the preprocessor, I always get a
> "NOTICE: BeginTransactionBlock not in default state" with my first BEGIN
If you want to expclicitely call BEGIN you either have to call ecpg with
option '-t' to change the default value or issue a EXEC SQL SET AUTOCOMMIT ON
in your program.
> statement. I've tried placing a COMMIT and END at the beginning of the
> app, but then I just get a NOTICE on the commit and another one on the
> BEGIN.
The default of ecpg is that it creates a transaction for all your action
automatically and you just issue COMMITs. After a COMMIT ecpg issues a BEGIN
all by himself. With SUTOCOMMIT set to ON ecpg uses the same logic as psql
for instance, namely that each statement is a transaction of its own unless
you issue a BEGIN.
Michael
--
Michael Meskes | Go SF 49ers!
Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!
Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!
Email: Michael@Fam-Meskes.De | Use PostgreSQL!
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: meskes@postgresql.org, rrothe@mindspring.com
Subject: Re: [INTERFACES] Always get TranBlock notice using 'c'
In-Reply-To: <19991224105633.B357@fam-meskes.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox