Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xlxej-0002t3-At for pgsql-admin@arkaria.postgresql.org; Wed, 05 Nov 2014 10:17:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xlxei-000784-5B for pgsql-admin@arkaria.postgresql.org; Wed, 05 Nov 2014 10:17:36 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xlxef-00077v-Ip for pgsql-admin@postgresql.org; Wed, 05 Nov 2014 10:17:34 +0000 Received: from nm30.bullet.mail.ir2.yahoo.com ([212.82.96.55]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xlxeb-0006S7-HO for pgsql-admin@postgresql.org; Wed, 05 Nov 2014 10:17:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1415182645; bh=8e+HO3PWa923kmnobTbgUa/KWpr/J12FKfLMZnayd6g=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=BxByUoxlHZTlT0I16UpRK5Jgy9FSMWnXU6Ja7tAxmCI2kn3E88xz2J/nmBcn3uUYJBWpyn2nXnQLOOCRoQEuSA6hUVENSuA+VJe5100fYciznmWkVAM96Z6OQMc+kG45Lu3yA2iET9VqfHHSnO8hRAdqdl+haJ2dGzqhPlWmfZ0RM3CIJreOH4YFRhFpm7gh4UUjc75Xrnv6jc7BI+jxms86TuOAh7ZaSzL5ruFWy+9id6zSb80Bi5lgifAr13rSndcyBOyPfWrMMqY1Jxa63gN+krlGm2pxf5zR6tKafQ6repUNDTXuP6CpVOAcd7cLtDX3Qdz7uR+k8/FMZfI2iA== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.de; b=nNr5AGXVQXvxcE6G8UFhOJJJZ+X2NQeKKepeFlgSaKoum6ucemI7k3LDQQiu8dDf2gRuctHz9UJGYnfHkVIxSXt6AszYxRdWGd6yZNVnFfJX5iz3cXnAR/vkWXM442nYKFN0aHoljKsjG7M6Fm/aQf6qrN7gFHBvSUkIkwGR2yVvSDC5nvtWI4p+GqqHoA6eqhzC0p4xZAlma3UVZ2aNA9HhPKOKJjUslXl9jGpY+PE5LPy42vTD3XPJBFl6TQvpylkaNnlsSxAoQjeGSbgqSMtL2ASQd5Yem5/HwYvs9XWVAOosT8F5JlBRnUk09zpNKuYl6Da3PXpSiZFYTkQqZg==; Received: from [212.82.98.61] by nm30.bullet.mail.ir2.yahoo.com with NNFMP; 05 Nov 2014 10:17:25 -0000 Received: from [212.82.98.64] by tm14.bullet.mail.ir2.yahoo.com with NNFMP; 05 Nov 2014 10:17:25 -0000 Received: from [127.0.0.1] by omp1001.mail.ir2.yahoo.com with NNFMP; 05 Nov 2014 10:17:25 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 312273.41152.bm@omp1001.mail.ir2.yahoo.com X-YMail-OSG: UK.MzWsVM1lG2c5iiHIsx8bqYYjKATMuA7_XwHNu9rI3vjh8jMJZqb2XeQJJ66r sIeH5c1A3e1NrHGa4tbM27yzOXYBokPSfaTmJkPPmphZn10iBFoJGDL1W_mwsoOIx.qftpK5pn9k PcvofZFzUOjNN7Y7DCkUxDqbnYA5oK6NtU8dG63EqX6RYJYuDxJZUxJS9IeltJ59CkI6Fu4lX41D f554_u0HoEik1sipGU6ljDyC6Qya5eISmE3jNvhYBWlr.fI4Cz9Rx9Cd2rca200y9CI26lTi23uD 1LG7T8Zfa_xilprFWqDUC_8SZYXIxDRbL5DsyjlXtqlCGz3euFwMSsvH2fByY3hakUjW_h_o_Fa2 C4RfZjaBc.3MIbIkISAPlvGKUJ_f89d3sVX_g4o3l4orgBTvUFFhaYtkF_JySrW4Y984u8vK8zhC K2sxxGaKtgHsvWlVRaR2IHU_oK5caOBT0lRXi8MkHA0EUHNctz2SdspRQLq1G0tY25.sqwptQMy7 Ly0IIuDyo3Q-- Received: by 212.82.98.117; Wed, 05 Nov 2014 10:17:24 +0000 Date: Wed, 5 Nov 2014 10:17:23 +0000 (UTC) From: Wolfgang Wilhelm Reply-To: Wolfgang Wilhelm To: Thomas Kellerer , "pgsql-admin@postgresql.org" Message-ID: <656182952.847732.1415182643649.JavaMail.yahoo@jws11170.mail.ir2.yahoo.com> In-Reply-To: References: Subject: Re: Autocommit off in psql MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_847731_1922488015.1415182643645" Content-Length: 9469 X-Pg-Spam-Score: -1.5 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org ------=_Part_847731_1922488015.1415182643645 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello Thomas, first of all thank you for your answer. This is basically what I found via Google, too, but is that up to date info= rmation? I found some more info that that setting isn't valid anymore. When I do that command which you sent, it seems to execute but when I do=20 show AUTOCOMMIT;=20 I get as as a result: =C2=A0autocommit------------ =C2=A0on (1 line) When I do the command which you mentioned with a semicolon at the end I get= an error message: Unknow boolean value: "on" assumed - well, at least I gu= ess it should be something like that because I get that in german. I tried with several other boolean values like 0, false, none, all with the= same result of show AUTOCOMMIT; Just a minute ago I realized that the output of show AUTOCOMMIT is somehow,= well, misleading. First I did setting autocommit off. Then I inserted some= data in a table. Another insert, a third. If autocommit would be on I'd ex= pect it to do a commit after every insert. But a rollback made them all thr= ee disappear. I found that in the help text of the show command AUTOCOMMIT = is not included. The question is why show outputs some info. But that shoul= dn't be your problem. Thank you for you assistance! RegardsWolfgang =20 Thomas Kellerer schrieb am 9:25 Mittwoch, 5.Novem= ber 2014: =20 =20 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... >=20 > 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.=20 You can use =C2=A0 \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 of= f. (although I rarely use psql or sqlplus) Regards Thomas --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin ------=_Part_847731_1922488015.1415182643645 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Thomas,

first of all thank you for your answer.
This is basic= ally what I found via Google, too, but is that up to date information? I fo= und some more info that that setting isn't valid anymore.
When I do that command which you sent, it se= ems to execute but when I do

show AUTOCOMM= IT;

I get as as a result:

 autocommit
-----= -------
 on
(1 line)

When I do the command which you mentio= ned with a semicolon at the end I get an error message: Unknow boolean valu= e: "on" assumed - well, at least I guess it should be something like that b= ecause I get that in german.
I tried with several other boolean values like= 0, false, none, all with the same result of show AUTOCOMMIT;

Just a minute ago I realized that t= he output of show AUTOCOMMIT is somehow, well, misleading. First I did sett= ing autocommit off. Then I inserted some data in a table. Another insert, a= third. If autocommit would be on I'd expect it to do a commit after every = insert. But a rollback made them all three disappear. I found that in the h= elp text of the show command AUTOCOMMIT is not included. The question is wh= y show outputs some info. But that shouldn't be your problem.

Thank you for you assistance!
=

Regards
Wolfgang





Thomas Kellerer <spam_eater@gmx.net> schrieb am 9:25 Mittw= och, 5.November 2014:




Wolfgang Wilhelm schrieb am 05.11.2014 um 09:= 08:
> There's an annoying difference between the datab= ase command line
> tools. Oracle doesn't have a BEGIN = for a transaction start but needs
> a commit for savin= g 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 litt= le bit more like sqlplus?
> "Set autocommit off" is ob= viously 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 autoco= mmit is automatically turned off.
(although I rarely use = psql or sqlplus)



Rega= rds

Thomas



--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



=
------=_Part_847731_1922488015.1415182643645--