"\set AUTOCOMMIT off" has affect

Started by Axel Straschilabout 20 years ago3 messagesgeneral
Jump to latest
#1Axel Straschil
axel@straschil.com

Hello!

I want to disable autocommit, my psqlrc:

SET client_min_messages = 'WARNING';
SET add_missing_from = false;
\set AUTOCOMMIT off

it has no effect:

echo "show AUTOCOMMIT" | psql
SET
SET
autocommit
------------
on
(1 row)

How can I disable autocommit in psqlrc?

Thanks,
Axel.

#2Andreas Seltenreich
seltenreich@gmx.de
In reply to: Axel Straschil (#1)
Re: "\set AUTOCOMMIT off" has affect

Axel Straschil writes:

I want to disable autocommit, my psqlrc:

SET client_min_messages = 'WARNING';
SET add_missing_from = false;
\set AUTOCOMMIT off

it has no effect:

echo "show AUTOCOMMIT" | psql
SET
SET
autocommit
------------
on
(1 row)

How can I disable autocommit in psqlrc?

It is. You're just looking at the no-op GUC variable instead of the
psql one. Try

\echo :AUTOCOMMIT

instead.

regards,
andreas
--

#3Axel Straschil
axel@straschil.com
In reply to: Axel Straschil (#1)
Re: "\set AUTOCOMMIT off" has affect

Hallo!

It is. You're just looking at the no-op GUC variable instead of the
psql one. Try
\echo :AUTOCOMMIT
instead.

Oh, your right, just tested, it is ;-)

Thanks,
AXEL.