Re: [SQL] Turn autocommit off ? - Mailing list pgsql-sql

From Federico Passaro
Subject Re: [SQL] Turn autocommit off ?
Date
Msg-id 360120B3.9EAE4313@link.it
Whole thread Raw
In response to Turn autocommit off ?  (Andreas Joppich <ajoppich@usa.net>)
Responses Re: [SQL] Turn autocommit off ?  (Bruce Momjian <maillist@candle.pha.pa.us>)
List 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.

Cheers

federico



pgsql-sql by date:

Previous
From: Andreas Joppich
Date:
Subject: Turn autocommit off ?
Next
From: "David J. Haglin"
Date:
Subject: IF..THEN..ELSE