pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Meskes <meskes@postgresql.org>
To: William West <wwest@csc.com>
Cc: pgsql-interfaces@postgresql.org
Subject: Re: ECPG - Clarfication of '-t', 'autocommit', BEGIN?
Date: Fri, 27 Sep 2002 13:26:58 +0200
Message-ID: <20020927112658.GA8723@feivel.credativ.de> (raw)
In-Reply-To: <OF1567F4D5.8BDE1A20-ON85256C40.005F08F9@com>
References: <OF1567F4D5.8BDE1A20-ON85256C40.005F08F9@com>

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!



view thread (2+ messages)

Message-ID: <20020927112658.GA8723@feivel.credativ.de>
Permalink:  ../20020927112658.GA8723@feivel.credativ.de/
Also on:    postgresql.org/message-id/20020927112658.GA8723@feivel.credativ.de

 · 

reply

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, wwest@csc.com
  Subject: Re: ECPG - Clarfication of '-t', 'autocommit', BEGIN?
  In-Reply-To: <20020927112658.GA8723@feivel.credativ.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