highgo=# \! cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
highgo=# select version();
version
------------------------------------
HighGo Database 3.1.4 Linux 64-bit
(1 row)
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
on
highgo=# \set autocommit off --此时执行后\echo :autocommit显示为on;此时标记为自定义变量autocommit
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
on
highgo=# \set AUTOCOMMIT off ---AUTOCOMMIT要完全大写才能生效
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
off
使用show命令是查询数据库中的参数值,大小写效果一样:
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# show AUTOCOMMIT;
autocommit
------------
on
(1 row)
highgo=# set AUTOCOMMIT TO on;
SET
highgo=# set AUTOCOMMIT TO oFF;
错误: SET AUTOCOMMIT TO OFF 不再被支持
highgo=# set AUTOCOMMIT TO off;
错误: SET AUTOCOMMIT TO OFF 不再被支持
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
highgo=# select version();
version
------------------------------------
HighGo Database 3.1.4 Linux 64-bit
(1 row)
highgo=# \set autocommit on
highgo=# \echo :autocommit
on
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \set autocommit off --此时执行后\echo :autocommit显示为OFF
highgo=# show autocommit;
autocommit
------------
on -->pg中此处show的结果不显示修改后的值(显示默认值on),需要使用如下echo命令
(1 row)
highgo=# \echo :autocommit
off
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
highgo=# \echo :AUTOCOMMIT
on
highgo=# \set autocommit off
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
on
highgo=# \echo :autocommit
off
highgo=# SELECT * FROM TEST;
id | name
----+------
3 |
4 |
(2 rows)
highgo=# insert into test values (5);
INSERT 0 1
highgo=# SELECT * FROM TEST;
id | name
----+------
3 |
4 |
5 |
(3 rows)
highgo=# \echo :autocommit --此处虽然小写autocommit的值改成了off,但并不生效;实际会话中还是为ON
off
highgo=# \echo :AUTOCOMMIT
on
Red Hat Enterprise Linux Server release 6.5 (Santiago)
highgo=# select version();
version
------------------------------------
HighGo Database 3.1.4 Linux 64-bit
(1 row)
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
on
highgo=# \set autocommit off --此时执行后\echo :autocommit显示为on;此时标记为自定义变量autocommit
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
on
highgo=# \set AUTOCOMMIT off ---AUTOCOMMIT要完全大写才能生效
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
off
使用show命令是查询数据库中的参数值,大小写效果一样:
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# show AUTOCOMMIT;
autocommit
------------
on
(1 row)
highgo=# set AUTOCOMMIT TO on;
SET
highgo=# set AUTOCOMMIT TO oFF;
错误: SET AUTOCOMMIT TO OFF 不再被支持
highgo=# set AUTOCOMMIT TO off;
错误: SET AUTOCOMMIT TO OFF 不再被支持
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
highgo=# select version();
version
------------------------------------
HighGo Database 3.1.4 Linux 64-bit
(1 row)
highgo=# \set autocommit on
highgo=# \echo :autocommit
on
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \set autocommit off --此时执行后\echo :autocommit显示为OFF
highgo=# show autocommit;
autocommit
------------
on -->pg中此处show的结果不显示修改后的值(显示默认值on),需要使用如下echo命令
(1 row)
highgo=# \echo :autocommit
off
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
highgo=# \echo :AUTOCOMMIT
on
highgo=# \set autocommit off
highgo=# show autocommit;
autocommit
------------
on
(1 row)
highgo=# \echo :AUTOCOMMIT
on
highgo=# \echo :autocommit
off
highgo=# SELECT * FROM TEST;
id | name
----+------
3 |
4 |
(2 rows)
highgo=# insert into test values (5);
INSERT 0 1
highgo=# SELECT * FROM TEST;
id | name
----+------
3 |
4 |
5 |
(3 rows)
highgo=# \echo :autocommit --此处虽然小写autocommit的值改成了off,但并不生效;实际会话中还是为ON
off
highgo=# \echo :AUTOCOMMIT
on