From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-admin@postgresql.org
Subject: Re: Autocommit off in psql
Date: Wed, 05 Nov 2014 09:24:40 +0100
Message-ID: <m3cms9$f0j$1@ger.gmane.org> (raw)
In-Reply-To: <1317404836.812502.1415174912912.JavaMail.yahoo@jws11120.mail.ir2.yahoo.com>
References: <1317404836.812502.1415174912912.JavaMail.yahoo@jws11120.mail.ir2.yahoo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
Wolfgang Wilhelm schrieb am 05.11.2014 um 09:08:
> There's an annoying difference between the database command line
> tools. Oracle doesn't have a BEGIN for a transaction start but needs
> a commit for saving changes. Psql on the other hand requires BEGIN to
> start an transaction or it will be in autocommit mode. Guess how much
> not so nice words I've heard in the last days because my team forgets
> that transaction begin...
>
> Is there any way to make psql work a little bit more like sqlplus?
> "Set autocommit off" is obviously no solution as it's not valid
> anymore.
You can use
\set AUTOCOMMIT off
in psql to turn off autocommit mode (note that this is case-sensitive!)
I have that line in my psqlrc file so autocommit is automatically turned off.
(although I rarely use psql or sqlplus)
Regards
Thomas
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
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-admin@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: Autocommit off in psql
In-Reply-To: <m3cms9$f0j$1@ger.gmane.org>
* 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