\d
对于每个与 pattern 匹配的关系(表、视图、物化视图、索引、序列或外部表)或复合类型,显示所有列、它们的类型、表空间(如果不是默认的)以及任何特殊属性,如 NOT NULL 或默认值。还显示相关的索引、约束、规则和触发器。对于外部表,还显示关联的外部服务器。( “ 匹配模式 ” 的定义在下面的 模式 中。)
当前查看 PostgreSQL 18。
中文定义与说明
对于每个与
pattern匹配的关系(表、视图、物化视图、索引、序列或外部表)或复合类型,显示所有列、它们的类型、表空间(如果不是默认的)以及任何特殊属性,如NOT NULL或默认值。还显示相关的索引、约束、规则和触发器。对于外部表,还显示关联的外部服务器。(“匹配模式”的定义在下面的模式中。)对于某些类型的关系,
\d显示每列的附加信息:序列的列值,索引的索引表达式,外部表的外部数据包装器选项。命令形式
\d+与前者相同,但会显示更多信息:表列关联的注释、表是否包含 OID、当关系为视图时的视图定义、非默认的复制标识设置,以及当关系具有访问方法时的访问方法名称。默认情况下,只显示用户创建的对象;提供一个模式或
S修饰符以包括系统对象。注意
如果使用
\d而没有pattern参数,它等同于\dtvmsE,它将显示所有可见的表、视图、物化视图、序列和外部表的列表。这纯粹是一种便利措施。与许多其他命令一样,如果在命令名后追加
x,仅此命令的结果会以扩展模式显示。但请注意,这只适用于不带pattern参数或用于描述序列的\d。同样的扩展输出限制也适用于\x on和\x auto。x修饰符不能直接紧跟在\d后面(因为\dx是另一个命令)。x只能出现在S或+修饰符之后。例如,\d+x等同于\dtvmsE+x,并以扩展模式显示所有关系的列表。
说明
对于每个与 pattern 匹配的关系(表、视图、物化视图、索引、序列或外部表)或复合类型,显示所有列、它们的类型、表空间(如果不是默认的)以及任何特殊属性,如 NOT NULL 或默认值。还显示相关的索引、约束、规则和触发器。对于外部表,还显示关联的外部服务器。( “ 匹配模式 ” 的定义在下面的 模式 中。)
- 客户端
- psql 18.7
- 区分大小写的写法
- \d
用法
\d[Sx+] [ pattern ]本版手册中的写法
| 命令 | 手册中的后缀修饰符 |
|---|---|
| \d | Sx+ |
手册定义
对于每个与
pattern匹配的关系(表、视图、物化视图、索引、序列或外部表)或复合类型,显示所有列、它们的类型、表空间(如果不是默认的)以及任何特殊属性,如NOT NULL或默认值。还显示相关的索引、约束、规则和触发器。对于外部表,还显示关联的外部服务器。(“匹配模式”的定义在下面的模式中。)对于某些类型的关系,
\d显示每列的附加信息:序列的列值,索引的索引表达式,外部表的外部数据包装器选项。命令形式
\d+与前者相同,但会显示更多信息:表列关联的注释、表是否包含 OID、当关系为视图时的视图定义、非默认的复制标识设置,以及当关系具有访问方法时的访问方法名称。默认情况下,只显示用户创建的对象;提供一个模式或
S修饰符以包括系统对象。注意
如果使用
\d而没有pattern参数,它等同于\dtvmsE,它将显示所有可见的表、视图、物化视图、序列和外部表的列表。这纯粹是一种便利措施。与许多其他命令一样,如果在命令名后追加
x,仅此命令的结果会以扩展模式显示。但请注意,这只适用于不带pattern参数或用于描述序列的\d。同样的扩展输出限制也适用于\x on和\x auto。x修饰符不能直接紧跟在\d后面(因为\dx是另一个命令)。x只能出现在S或+修饰符之后。例如,\d+x等同于\dtvmsE+x,并以扩展模式显示所有关系的列表。
相关条目
文档与源码
来源构建
- 版本
- 18.7
- 构建
- https://ftp.postgresql.org/pub/source/v18.7/postgresql-18.7.tar.bz2
- 来源指纹
1b2d62b4845aa46374f2cb680f95d3392322cc8128646992ae4e18d0e7084915
版本比较
PostgreSQL 13 → 14: 属性变化。
以下差异保留原始字段名与英文源描述。
--- PostgreSQL 13
+++ PostgreSQL 14
@@ -1,5 +1,5 @@
{
- "definition": "For each relation (table, view, materialized view, index, sequence, or foreign table) or composite type matching the pattern , show all columns, their types, the tablespace (if not the default) and any special attributes such as NOT NULL or defaults. Associated indexes, constraints, rules, and triggers are also shown. For foreign tables, the associated foreign server is shown as well. ( “ Matching the pattern ” is defined in Patterns below.) For some types of relation, \\d shows additional information for each column: column values for sequences, indexed expressions for indexes, and foreign data wrapper options for foreign tables. The command form \\d+ is identical, except that more information is displayed: any comments associated with the columns of the table are shown, as is the presence of OIDs in the table, the view definition if the relation is a view, a non-default replica identity setting. By default, only user-created objects are shown; supply a pattern or the S modifier to include system objects. Note If \\d is used without a pattern argument, it is equivalent to \\dtvmsE which will show a list of all visible tables, views, materialized views, sequences and foreign tables. This is purely a convenience measure.",
+ "definition": "For each relation (table, view, materialized view, index, sequence, or foreign table) or composite type matching the pattern , show all columns, their types, the tablespace (if not the default) and any special attributes such as NOT NULL or defaults. Associated indexes, constraints, rules, and triggers are also shown. For foreign tables, the associated foreign server is shown as well. ( “ Matching the pattern ” is defined in Patterns below.) For some types of relation, \\d shows additional information for each column: column values for sequences, indexed expressions for indexes, and foreign data wrapper options for foreign tables. The command form \\d+ is identical, except that more information is displayed: any comments associated with the columns of the table are shown, as is the presence of OIDs in the table, the view definition if the relation is a view, a non-default replica identity setting and the access method name if the relation has an access method. By default, only user-created objects are shown; supply a pattern or the S modifier to include system objects. Note If \\d is used without a pattern argument, it is equivalent to \\dtvmsE which will show a list of all visible tables, views, materialized views, sequences and foreign tables. This is purely a convenience measure.",
"modifiers": [
{
"command": "\\d",
比较已记录的接口与属性,排除来源指纹和构建元数据。某个样本中没有记录,不能据此判断实际引入或移除的版本。
相关条目
导出 JSON · 返回psql 命令 · 收录范围为 PostgreSQL 10 至 20;最早采样版本不一定是实际引入版本。