\copy ... perform SQL COPY with data stream to the client host \echo[STRING]writestringto standard output \i FILE execute commands fromfile\o [FILE] send all query results tofileor |pipe \qecho [STRING]writestringto query output stream (see \o) Informational (options: S= show system o...
variables show help on special variables \h [NAME] help on syntax of SQL commands, * for all commandsQuery Buffer \e [FILE] [LINE] edit the query buffer (or file) with external editor \ef [FUNCNAME [LINE]] edit function definition with external editor...Informational (o...
\watch[SEC]execute query every SEC seconds Help \?[commands]show help on backslash commands \?options show help on psql command-line options \?variables show help on special variables \h[NAME]help on syntax of SQL commands,*forall commands Query Buffer \e[FILE][LINE]edit the query buffer(...
任何斜杠命令 ( \) 都用于指定一个元命令,该命令通常会在后台运行必要的 SQL 查询并以可读格式返回结果。 首先,让我们看一下有关 psql 作为命令行工具工作的一些技巧。了解如何启用某些功能或为每个元命令找到帮助,将有助于您更好的使用它。 01 分号是必需的 PostgreSQL 遵守 ANSI SQL 标准,该标准规定了语句终...
>$ psql -f g.sql ?column? --- select 1234567890 (1 row) 【命令: \h 】 功能介绍: 帮助 SQL 命令的语法,*用于所有命令 #查看所有的命令 testdb=# \h * Command: ABORT Description: abort the current transaction Syntax: ABORT [ WORK | TRANSACTION ] ... #查看建表语句 testdb=# \h cre...
\watch [SEC] execute query every SEC seconds Help \? [commands] show help on backslash commands \? options show help on psql command-line options \? variables show help on special variables \h [NAME] help on syntax of SQL commands, * for all commands ...
-c, --command=COMMAND run only single command (SQL or internal) and exit -d, --dbname=DBNAME database name to connect to (default: "postgres") -f, --file=FILENAME execute commands from file, then exit -l, --list list available databases, then exit ...
version: 2 jobs: build: docker: - image: your-docker-image steps: - checkout - run: name: Install PostgreSQL client command: apt-get update && apt-get install -y postgresql-client - run: name: Connect to database and execute SQL query command: psql -h your-database-host -U your-us...
--command command 声明psql 将执行一条查询字串, command,然后退出。这一点在 shell 脚本里很有用。 command 必须是一条完全可以被服务器分析的查询字串(也就是说,它不包含 psql特有的特性), 或者是一个反斜杠命令。这样你就不会混合SQL和 psql 元命令。要想混合使用,你可以把字串定向到 psql里,象这样: ...
-c, --command=COMMAND run only single command (SQL or internal) and exit -d, --dbname=DBNAME database name to connect to (default: "gpadmin") -f, --file=FILENAME execute commands from file, then exit -l, --list list available databases, then exit ...