1. psql --help

psql is the PostgreSQL interactive terminal.

Usage:
psql [OPTION]... [DBNAME [USERNAME]] General options:
-c, --command=COMMAND run only single command (SQL or internal) and exit
-d, --dbname=DBNAME database name to connect to (default: "xingxing.duan")
-f, --file=FILENAME execute commands from file, then exit
-l, --list list available databases, then exit
-v, --set=, --variable=NAME=VALUE
set psql variable NAME to VALUE
-V, --version output version information, then exit
-X, --no-psqlrc do not read startup file (~/.psqlrc)
-1 ("one"), --single-transaction
execute as a single transaction (if non-interactive)
-?, --help show this help, 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
-L, --log-file=FILENAME send session log to file
-n, --no-readline disable enhanced command line editing (readline)
-o, --output=FILENAME send query results to file (or |pipe)
-q, --quiet run quietly (no messages, only query output)
-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
field separator for unaligned output (default: "|")
-H, --html HTML table output mode
-P, --pset=VAR[=ARG] set printing option VAR to ARG (see \pset command)
-R, --record-separator=STRING
record separator for unaligned output (default: newline)
-t, --tuples-only print rows only
-T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border)
-x, --expanded turn on expanded table output
-z, --field-separator-zero
set field separator for unaligned output to zero byte
-0, --record-separator-zero
set record separator for unaligned output to zero byte Connection options:
-h, --host=HOSTNAME database server host or socket directory (default: "local socket")
-p, --port=PORT database server port (default: "5432")
-U, --username=USERNAME database user name (default: "xingxing.duan")
-w, --no-password never prompt for password
-W, --password force password prompt (should happen automatically) For more information, type "\?" (for internal commands) or "\help" (for SQL
commands) from within psql, or consult the psql section in the PostgreSQL
documentation. Report bugs to <pgsql-bugs@postgresql.org>.

2.备份数据库

/opt/pg94/bin/pg_dump  -U user  -i -E UTF8 -F p -f /home/q/tmp/ticket_report.sql  -h host -d database

  

postgres备份数据库的更多相关文章

  1. postgres 备份数据库

    https://www.postgresql.org/docs/9.1/static/app-pgdump.html bash-4.2$ pg_dump -Fc xianlan_prod > / ...

  2. postgres的数据库备份和恢复

    备份和恢复 一条命令就可以解决很简单: 这是备份的命令: pg_dump -h 127/0.0.1 -U postgres databasename > databasename.bak 指令解 ...

  3. postgresql备份数据库

    备份数据库:pg_dump -U username -h localhost -f /me.sql 数据库名; 恢复数据库:psql -U username -h localhost -f /me.s ...

  4. shell编程-定时任务(备份数据库)

    计划任务定时备份,删除等操作: #crontab -e #注意 会区分用户 默认在root用户登录用的是root权限用户的计划任务, 如果想在postgres备份 应使用postgres用户权限, 设 ...

  5. php备份数据库

    php备份数据库原理和方法 原理 查找所有表 查找所有字段,列出所有字段名 字段类型等信息 查找所有数据 读取后注意特殊符号转换addslashes() 生成sql 把数据库格式化生成对应sql 相关 ...

  6. oracle 备份数据库对象(存储过程PROCEDURE,FUNCTION,VIEW,TRIGGER...)

    开发过程中,需要不停的备份数据库对象, 特别是存储过程, 每次手动备份不免很低能啊 历经几次修改终于, 完美了,O(∩_∩)O哈哈~      (当然,你也可以再改简便一点~~~) select db ...

  7. Oracle如何实现创建数据库、备份数据库及数据导出导入的一条龙操作

    Oracle中对数据对象和数据的管理,无疑都是使用PL/SQL Developer来进行管理,该工具也提供给我们很多方便.快捷的操作,使得我们不再为Oracle本身丑陋.难用的UI而抱怨.由于我们一般 ...

  8. Sql Server自动备份数据库,定期删除备份

    //实现:每天自动备份数据库,定期删除备份 //步骤:[开始]--[所有程序]--[Microsoft SQL Server 2005]--[SQL Server Management Studio] ...

  9. 知方可补不足~SqlServer自动备份数据库及清理备份文件

    回到目录 对于SQLSERVER这个关系型数据库来说,为了保持数据的安全,备份是必须的,当你的一个误操作导致数据丢失,这可能是灾难性的,是不被允许发生的,这时,我们必须要做好定期的备份工作,如我们可以 ...

随机推荐

  1. 一些排序 (python实现)

    ►快速排序 <时间复杂度O(n㏒n)> def partition(li,left,right): tmp = li[left] while left < right: while ...

  2. js高级程序设计 笔记 --- 表单

    一,基础知识 在html中,表单是form元素,而在js中,表单对应的是HTMLFormElement类型,继承自HTMLElement,其独特的属性和方法有(常见): action:接收请求的URL ...

  3. Effective C++ 改善55个方法

    美·Scott Meyers 候捷 电子工业 2011 刚才看到个会议时间有点晚,3.25论文都提交了 谷歌去广告的插件, 最后投了这个会议,刚刚好正合适.我说金钱与时间 ACCUSTOMING YO ...

  4. php codeception

    前言 本测试用例只针对yii2 basic框架而写,若要支持其他框架,请自行查看phpcodeception指导(需要FQ)http://codeception.com/ yii2 basic默认已经 ...

  5. 点击劫持(click jacking)

    什么是点击劫持劫持原理劫持案例代码示例优酷频道刷粉的POC腾讯微博刷粉防御 什么是点击劫持 点击劫持,clickjacking,也被称为UI-覆盖攻击.这个词首次出现在2008年,是由互联网安全专家罗 ...

  6. React条件性渲染

    React条件性渲染的方式和Vue是不同的,之前用vue做项目时觉得vue是在是强大,通过v-if就可以选择性的渲染组件,另外,对于列表的渲染更是方便,一个v-for就可以进行快速的渲染,但是Reac ...

  7. Mac下使用wireshark解决Interface为空的办法

    Terminal中运行chown <user-name> /dev/bpf*命令 <user-name>处替换为当前mac用户名

  8. iOS 模拟器截屏快捷键

    iOS 模拟器截屏快捷键: cmd+S

  9. Go语言备忘录(1):基本数据结构

    本文内容是本人对Go语言的变量.常量.数组.切片.映射.结构体的备忘录,记录了关键的相关知识点,以供翻查. 文中如有错误的地方请大家指出,以免误导!转摘本文也请注明出处:Go语言备忘录(1):基本数据 ...

  10. mybatis学习之分页

    分页一般分为物理分页:先查询所有值再分页输出,逻辑分页:直接分页查询输出,mybatis支持物理分页,如下: 1.物理分页: mapper映射: <select id="findStu ...