PSQL

This is psql 8.2.15, the PostgreSQL interactive terminal (Greenplum version).

Usage:
psql [OPTION]... [DBNAME [USERNAME]]

General options:

-c, --command=COMMAND    run only single command (SQL or internal) and exit
 声明 psql 将执行一条查询字串, command,然后退出
-d, --dbname=DBNAME      database name to connect to (default: "hadoop")
 声明数据库名称。等效于在命令行行上把 dbname 声明为第一个非选项参数。
-f, --file=FILENAME      execute commands from file, then exit
 使用 filename作为命令的语句源而不是交互式读入查询。 在处理完文件后,psql 结束。这个选项在很多方面等效于内部命令 \i。
 如果 filename 是 -(连字符),则从标准输入读取。
-l, --list               list available databases, then exit
 列出所有可用的数据库
-v, --set=, --variable=NAME=VALUE
                          set psql variable NAME to VALUE
 进行一次变量分配,象内部命令 \set 那样。
 注意,如果有变量名和值的话,你必须在命令行上用等号分隔它们。
-X, --no-psqlrc          do not read startup file (~/.psqlrc)
 不读取启动文件(系统的 psqlrc 或者你的 ~/.psqlrc 都不读取)。
--help                   show this help, then exit
--version                output version information, then exit

Input and output options:

-a, --echo-all           echo all input from script
 在读取行时向标准输出打印所有内容。 这个选项在脚本处理时比交互模式时更有用。
-e, --echo-queries       echo commands sent to server
 把所有发送给服务器的查询同时也拷贝到标准输出
-E, --echo-hidden        display queries that internal commands generate
 回显由\d和其他反斜杠命令生成的实际查询。
-L, --log-file=FILENAME  send session log to file
 除了正常的输出源之外,把所有查询输出记录到文件 filename。
-n, --no-readline        disable enhanced command line editing (readline)
-o, --output=FILENAME    send query results to file (or |pipe)
 将所有查询输出定向到文件 filename
-q, --quiet              run quietly (no messages, only query output)
 声明 psql 将安静地执行处理任务
-s, --single-step        single-step mode (confirm each query)
 进入单步模式运行。意味着每个查询在发往服务器之前都要提示用户, 用这个选项也可以取消执行
-S, --single-line        single-line mode (end of line terminates SQL command)
 进入单行运行模式,这时每个命令都将由换行符结束,象分号那样

Output format options:

-A, --no-align                            unaligned table output mode
 未对其输出模式
-F, --field-separator=STRING
 指定列分割字符串
                                                    set field separator (default: "|")
-H, --html                                  HTML table output mode
 HTML输出模式
-P, --pset=VAR[=ARG]               set printing option VAR to ARG (see \pset command)
 设置打印选项
-R, --record-separator=STRING
                                                    set record separator (default: newline)
 设置记录行分隔符
-t, --tuples-only                         print rows only
 只打印行
-T, --table-attr=TEXT                 set HTML table tag attributes (e.g., width, border)
 设置HTML表格属性
-x, --expanded                           turn on expanded table output
 打开表格扩展输出模式



转载于:https://my.oschina.net/darionyaphet/blog/326782

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值