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

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

百科 / psql 命令 / 脚本与帮助

\cd

将当前工作目录更改为 directory 。如果没有参数,则切换到当前用户的主目录。关于如何确定主目录,请参见 第 32.16 节 。

当前查看 PostgreSQL 18.6。

说明

将当前工作目录更改为 directory 。如果没有参数,则切换到当前用户的主目录。关于如何确定主目录,请参见 第 32.16 节 。

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

用法

\cd [ directory ]

本版手册中的写法

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

手册定义

\cd [ directory ]

将当前工作目录更改为 directory。如果没有参数,则切换到当前用户的主目录。关于如何确定主目录,请参见第 32.16 节。

提示

要打印当前工作目录,请使用\! pwd。

相关条目

文档与源码

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

版本比较

PostgreSQL 19 → 20: 属性变化。

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

--- PostgreSQL 19
+++ PostgreSQL 20
@@ -1,5 +1,5 @@
 {
-  "definition": "Changes the current working directory to directory . Without argument, changes to the current user's home directory. For details on how home directories are found, see Section 32.16 . Tip To print your current working directory, use \\! pwd .",
+  "definition": "Changes the current working directory to directory . Without argument, changes to the current user's home directory. For details on how home directories are found, see Section 32.15 . Tip To print your current working directory, use \\! pwd .",
   "modifiers": [],
   "signature": "\\cd [ directory ]",
   "spellings": [

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

相关条目

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