PostgreSQL进程是“交易中的闲置”是什么意思? [英] What does it mean when a PostgreSQL process is "idle in transaction"?

查看:99
本文介绍了PostgreSQL进程是“交易中的闲置”是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PostgreSQL 进程处于空闲状态是什么意思?

What does it mean when a PostgreSQL process is "idle in transaction"?

在我正在查看的服务器上,输出 ps ax | grep postgres,我看到9个PostgreSQL进程,如下所示:

On a server that I'm looking at, the output of "ps ax | grep postgres" I see 9 PostgreSQL processes that look like the following:

postgres: user db 127.0.0.1(55658) idle in transaction

这是否意味着某些进程已挂起,正在等待事务提交?

Does this mean that some of the processes are hung, waiting for a transaction to be committed? Any pointers to relevant documentation are appreciated.

推荐答案

PostgreSQL手册表示这意味着事务处于打开状态(在BEGIN内部)并且处于空闲状态。最有可能是用户正在使用正在思考或打字的监视器进行连接。我的系统上也有很多。

The PostgreSQL manual indicates that this means the transaction is open (inside BEGIN) and idle. It's most likely a user connected using the monitor who is thinking or typing. I have plenty of those on my system, too.

如果您使用Slony复制,则 Slony-I常见问题解答建议交易空闲可能意味着网络连接突然终止。查看该常见问题解答中的讨论以获取更多详细信息。

If you're using Slony for replication, however, the Slony-I FAQ suggests idle in transaction may mean that the network connection was terminated abruptly. Check out the discussion in that FAQ for more details.

这篇关于PostgreSQL进程是“交易中的闲置”是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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