Postgres设置全局自动提交 [英] Postgres setting autocommit off globally

查看:161
本文介绍了Postgres设置全局自动提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在全局级别的psql 8.4中设置自动提交功能?是否有一个我可以更改的配置属性,该属性会为群集上的所有数据库引入此行为以启动自动提交关闭的数据库会话?

How do you set autocommit off in psql 8.4 at a global level? is there a configuration attribute that i can change that will introduce this behaviour for all dbs on a cluster to start db sessions with autocommit off?

推荐答案

只需将以下内容添加到〜/ .psqlrc

Simply add the following to ~/.psqlrc:

\set AUTOCOMMIT off 

请注意,仅当使用 psql 外壳!我以为这就是你在说什么?

Note that this only works when using the psql shell! I assume this is what you are talking about?

这篇关于Postgres设置全局自动提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆