Re: [SQL] Turn autocommit off ?

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Andreas Joppich <ajoppich(at)usa(dot)net>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: [SQL] Turn autocommit off ?
Date: 1998-09-18 17:29:54
Message-ID: Pine.LNX.3.96.980918182707.495G-100000@maidast.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, 17 Sep 1998, Andreas Joppich wrote:

> Hi there !
>
> It has now happened several times that I wanted to rollback some
> changes (like update, delete,...) I made to some tables. And since I
> always forget to start a transaction, a simple ROLLBACK doesn't work
> because of that quiet annoying autocommit in psql.
>
> I'd like to have automatically started a transaction which explicitly
> must be termintated with commit or rollback.
>
> Is there a way to turn autocommit off ? If not, perhaps it could
> be a feature for the todo list ?

You didn't say if it was from psql or one of the other interfaces.

With JDBC, you turn autocommit off with the setAutoCommit() method in
Connection:

To turn off:

Connection con = DriverManager.getConnection(url,user,password);
con.setAutoCommit(false);

>
> I'm currently using the cvs from last sunday on linux 2.1.119.
>
> Thanks for any hints.
>
> Andreas
>

--
Peter T Mount peter(at)retep(dot)org(dot)uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ian Johnston 1998-09-19 21:53:19 date problem
Previous Message Bruce Momjian 1998-09-18 16:21:38 Re: [SQL] PostgreSQL syntax question