Received: from mail.ngi.de ([195.243.0.227]) by hub.org (8.9.3/8.9.3) with ESMTP id FAA99822 for ; Fri, 24 Dec 1999 05:03:22 -0500 (EST) (envelope-from michael@fam-meskes.de) Received: from p3E9D3E35.dip0.t-ipconnect.de (root@p3E9D3E35.dip0.t-ipconnect.de [62.157.62.53]) by mail.ngi.de (8.9.3/8.9.3) with ESMTP id LAA80651; Fri, 24 Dec 1999 11:04:36 +0100 (CET) (envelope-from michael@fam-meskes.de) Received: (from michael@localhost) by tanja.fam-meskes.de (8.9.3/8.9.0/Debian/GNU) id KAA00378; Fri, 24 Dec 1999 10:56:33 +0100 Date: Fri, 24 Dec 1999 10:56:33 +0100 From: Michael Meskes To: Robert Rothe Cc: "pgsql-interfaces@postgreSQL.org" Subject: Re: [INTERFACES] Always get TranBlock notice using 'c' Message-ID: <19991224105633.B357@fam-meskes.de> Mail-Followup-To: Robert Rothe , "pgsql-interfaces@postgreSQL.org" References: <38628B50.FF9F52B7@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <38628B50.FF9F52B7@mindspring.com>; from rrothe@mindspring.com on Thu, Dec 23, 1999 at 03:51:28PM -0500 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!