\ev
这个命令获取并编辑指定视图的定义,形式为 CREATE OR REPLACE VIEW 命令。编辑方式与 \edit 相同。如果在不保存的情况下退出编辑器,则该语句会被丢弃。如果保存并退出编辑器,并在其中添加了分号,则更新后的命令会立即执行;否则将重新显示;输入分号或 \g 发送它,或用 \r 取消。
当前查看 PostgreSQL 18.6。
说明
这个命令获取并编辑指定视图的定义,形式为 CREATE OR REPLACE VIEW 命令。编辑方式与 \edit 相同。如果在不保存的情况下退出编辑器,则该语句会被丢弃。如果保存并退出编辑器,并在其中添加了分号,则更新后的命令会立即执行;否则将重新显示;输入分号或 \g 发送它,或用 \r 取消。
- 客户端
- psql 18.6
- 区分大小写的写法
- \ev
用法
\ev [ view_name [ line_number ] ]本版手册中的写法
| 命令 | 手册中的后缀修饰符 |
|---|---|
| \ev | 此语法签名未列出 |
手册定义
\ev [view_name[line_number] ]-
这个命令获取并编辑指定视图的定义,形式为
CREATE OR REPLACE VIEW命令。编辑方式与\edit相同。如果在不保存的情况下退出编辑器,则该语句会被丢弃。如果保存并退出编辑器,并在其中添加了分号,则更新后的命令会立即执行;否则将重新显示;输入分号或\g发送它,或用\r取消。如果未指定视图,则会呈现一个空的
CREATE VIEW模板供编辑。如果指定了行号,psql将光标定位在视图定义的指定行上。
与大多数其他元命令不同,整个行的剩余部分始终被视为
\ev的参数,参数中不进行变量插值或反引号扩展。
相关条目
文档与源码
来源构建
- 版本
- 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": "This command fetches and edits the definition of the named view, in the form of a CREATE OR REPLACE VIEW command. Editing is done in the same way as for \\edit . After the editor exits, the updated command is executed immediately if you added a semicolon to it. Otherwise it is redisplayed; type semicolon or \\g to send it, or \\r to cancel. If no view is specified, a blank CREATE VIEW template is presented for editing. If a line number is specified, psql will position the cursor on the specified line of the view definition. Unlike most other meta-commands, the entire remainder of the line is always taken to be the argument(s) of \\ev , and neither variable interpolation nor backquote expansion are performed in the arguments.",
+ "definition": "This command fetches and edits the definition of the named view, in the form of a CREATE OR REPLACE VIEW command. Editing is done in the same way as for \\edit . If you quit the editor without saving, the statement is discarded. If you save and exit the editor, the updated command is executed immediately if you added a semicolon to it. Otherwise it is redisplayed; type semicolon or \\g to send it, or \\r to cancel. If no view is specified, a blank CREATE VIEW template is presented for editing. If a line number is specified, psql will position the cursor on the specified line of the view definition. Unlike most other meta-commands, the entire remainder of the line is always taken to be the argument(s) of \\ev , and neither variable interpolation nor backquote expansion are performed in the arguments.",
"modifiers": [],
"signature": "\\ev [ view_name [ line_number ] ]",
"spellings": [
比较已记录的接口与属性,排除来源指纹和构建元数据。某个样本中没有记录,不能据此判断实际引入或移除的版本。
相关条目
导出 JSON · 返回psql 命令 · 收录范围为 PostgreSQL 10 至 20;最早采样版本不一定是实际引入版本。