Skip site navigation (1) Skip section navigation (2)

Re: [SQL] Turn autocommit off ?

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: fede(at)link(dot)it (Federico Passaro)
Cc: ajoppich(at)usa(dot)net, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Turn autocommit off ?
Date: 1998-09-17 16:02:20
Message-ID: 199809171602.MAA01544@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-sql
> 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 ?
> >
> > I'm currently using the cvs from last sunday on linux 2.1.119.
> >
> > Thanks for any hints.
> >
> > Andreas
> 
>  You can edit  your ~/.psqlrc (or /etc/psqlrc) an put a
> 
> begin;
> 
> line into it. The drawback is that if you do not issue a "commit"
> command you loose all your changes.

The problem with this is that is that when he does his first COMMIT, he
is not started in a new transaction block.

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us              |  Drexel Hill, Pennsylvania 19026
http://www.op.net/~candle              |  (610) 353-9879(w)
  +  If your life is a hard drive,     |  (610) 853-3000(h)
  +  Christ can be your backup.        |

In response to

pgsql-sql by date

Next:From: David RuggeDate: 1998-09-18 02:14:44
Subject: postmaster dies on complicated views
Previous:From: Bruce MomjianDate: 1998-09-17 16:00:20
Subject: Re: [SQL] Turn autocommit off ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group