Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DC791476030 for ; Fri, 27 Sep 2002 07:23:02 -0400 (EDT) Received: from www.credativ.de (cdt1.tz-juelich.de [195.37.52.66]) by postgresql.org (Postfix) with ESMTP id CFBED475F66 for ; Fri, 27 Sep 2002 07:23:01 -0400 (EDT) Received: from feivel.credativ.de (feivel.credativ.de [172.26.14.7]) by www.credativ.de (Postfix) with ESMTP id 47F191C0006; Fri, 27 Sep 2002 13:27:03 +0200 (CEST) Received: by feivel.credativ.de (Postfix, from userid 1000) id 6F256A6030; Fri, 27 Sep 2002 13:26:58 +0200 (CEST) Date: Fri, 27 Sep 2002 13:26:58 +0200 From: Michael Meskes To: William West Cc: pgsql-interfaces@postgresql.org Subject: Re: ECPG - Clarfication of '-t', 'autocommit', BEGIN? Message-ID: <20020927112658.GA8723@feivel.credativ.de> Mail-Followup-To: William West , pgsql-interfaces@postgresql.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/86 X-Sequence-Number: 3147 On Thu, Sep 26, 2002 at 01:57:40PM -0400, William West wrote: > The ecpg man page says that '-t' will turn autocommit 'on', that > the default is that otherwise a 'commit' statement is needed to > cause a 'commit'. > ... Which indeed is correct. "Autocommit" means that the mode is the same as with for instance psql. Each statement is run inside its own transaction and thus you do only need a "commit" if you specified a "begin" before. Without "autocommit" the mode is equivalent to Oracle in that an explicit transaction is started automatically and all you need to do is issue a "commit" or "rollback" to end. After that a new transaction is started immediately. > Am I wrong in thinking that BEGIN-(set of commands) > -COMMIT should be equivalent to 'start transaction > -perform sequence of commands-commit result of > sequence of commands'? Or does BEGIN become > superfluous when running *without* -t? Could someone > please clarify? Yes, that's it. No need to say "begin" when not using "-t". Michael -- Michael Meskes Michael@Fam-Meskes.De Go SF 49ers! Go Rhein Fire! Use Debian GNU/Linux! Use PostgreSQL!