↑↓ 选择 ↵ 打开 ⌫ 改范围 完整检索页

pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。

百科 / psql 命令 / 连接与会话

\conninfo

输出当前数据库连接的信息;如果正在使用 SSL,也包括与 SSL 相关的信息。

当前查看 PostgreSQL 18.6。

说明

输出当前数据库连接的信息;如果正在使用 SSL,也包括与 SSL 相关的信息。

客户端
psql 18.6
区分大小写的写法
\conninfo

用法

\conninfo

本版手册中的写法

命令手册中的后缀修饰符
\conninfo此语法签名未列出

手册定义

\conninfo

输出当前数据库连接的信息;如果正在使用 SSL,也包括与 SSL 相关的信息。

请注意,Client User 字段显示的是连接建立时的用户,而 Superuser 字段表示当前用户(在当前执行上下文中)是否具有超级用户权限。这两个用户通常相同,但也可能不同,例如当前用户曾通过 SET ROLE 命令被更改。

相关条目

文档与源码

来源构建
版本
18.6
构建
https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
来源指纹
ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8

版本比较

PostgreSQL 17 → 18: 属性变化。

以下差异保留原始字段名与英文源描述。

--- PostgreSQL 17
+++ PostgreSQL 18
@@ -1,5 +1,5 @@
 {
-  "definition": "Outputs information about the current database connection.",
+  "definition": "Outputs information about the current database connection, including SSL-related information if SSL is in use. Note that the Client User field shows the user at the time of connection, while the Superuser field indicates whether the current user (in the current execution context) has superuser privileges. These users are usually the same, but they can differ, for example, if the current user was changed with the SET ROLE command.",
   "modifiers": [],
   "signature": "\\conninfo",
   "spellings": [

比较已记录的接口与属性,排除来源指纹和构建元数据。某个样本中没有记录,不能据此判断实际引入或移除的版本。

相关条目

导出 JSON · 返回psql 命令 · 收录范围为 PostgreSQL 10 至 20;最早采样版本不一定是实际引入版本。