\list
列出服务器中的数据库,并显示其名称、所有者、字符集编码和访问权限。如果指定了 pattern ,则只列出名称与模式匹配的数据库。如果在命令名后追加 x ,结果会以扩展模式显示。如果在命令名后追加 + ,则还会显示数据库大小、默认表空间和描述。当前用户对其拥有 CONNECT 权限的数据库可以显示大小信息;如果当前用户是超级用户或具有 pg_read_all_stats 角色的权限,也可以显示大小信息。
当前查看 PostgreSQL 18.6。
说明
列出服务器中的数据库,并显示其名称、所有者、字符集编码和访问权限。如果指定了 pattern ,则只列出名称与模式匹配的数据库。如果在命令名后追加 x ,结果会以扩展模式显示。如果在命令名后追加 + ,则还会显示数据库大小、默认表空间和描述。当前用户对其拥有 CONNECT 权限的数据库可以显示大小信息;如果当前用户是超级用户或具有 pg_read_all_stats 角色的权限,也可以显示大小信息。
- 客户端
- psql 18.6
- 区分大小写的写法
- \list
用法
\l[x+] or \list[x+] [ pattern ]手册定义
\l[x+]或\list[x+] [pattern]-
列出服务器中的数据库,并显示其名称、所有者、字符集编码和访问权限。如果指定了
pattern,则只列出名称与模式匹配的数据库。如果在命令名后追加x,结果会以扩展模式显示。如果在命令名后追加+,则还会显示数据库大小、默认表空间和描述。当前用户对其拥有CONNECT权限的数据库可以显示大小信息;如果当前用户是超级用户或具有pg_read_all_stats角色的权限,也可以显示大小信息。
相关条目
文档与源码
来源构建
- 版本
- 18.6
- 构建
- https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2
- 来源指纹
ee8d1a3612338fd9adf250730cb640fcc5233b5491337cc00a316a44e3a0b9f8
版本比较
PostgreSQL 13 → 14: 属性变化。
以下差异保留原始字段名与英文源描述。
--- PostgreSQL 13
+++ PostgreSQL 14
@@ -1,5 +1,5 @@
{
- "definition": "List the databases in the server and show their names, owners, character set encodings, and access privileges. If pattern is specified, only databases whose names match the pattern are listed. If + is appended to the command name, database sizes, default tablespaces, and descriptions are also displayed. (Size information is only available for databases that the current user can connect to.)",
+ "definition": "List the databases in the server and show their names, owners, character set encodings, and access privileges. If pattern is specified, only databases whose names match the pattern are listed. If + is appended to the command name, database sizes, default tablespaces, and descriptions are also displayed. Size information is available for databases on which the current user has CONNECT privilege, or if the current user is a superuser or has privileges of the pg_read_all_stats role.",
"modifiers": [
{
"command": "\\l",
比较已记录的接口与属性,排除来源指纹和构建元数据。某个样本中没有记录,不能据此判断实际引入或移除的版本。
相关条目
导出 JSON · 返回psql 命令 · 收录范围为 PostgreSQL 10 至 20;最早采样版本不一定是实际引入版本。