postgres备份数据库
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备份数据库的更多相关文章
- postgres 备份数据库
https://www.postgresql.org/docs/9.1/static/app-pgdump.html bash-4.2$ pg_dump -Fc xianlan_prod > / ...
- postgres的数据库备份和恢复
备份和恢复 一条命令就可以解决很简单: 这是备份的命令: pg_dump -h 127/0.0.1 -U postgres databasename > databasename.bak 指令解 ...
- postgresql备份数据库
备份数据库:pg_dump -U username -h localhost -f /me.sql 数据库名; 恢复数据库:psql -U username -h localhost -f /me.s ...
- shell编程-定时任务(备份数据库)
计划任务定时备份,删除等操作: #crontab -e #注意 会区分用户 默认在root用户登录用的是root权限用户的计划任务, 如果想在postgres备份 应使用postgres用户权限, 设 ...
- php备份数据库
php备份数据库原理和方法 原理 查找所有表 查找所有字段,列出所有字段名 字段类型等信息 查找所有数据 读取后注意特殊符号转换addslashes() 生成sql 把数据库格式化生成对应sql 相关 ...
- oracle 备份数据库对象(存储过程PROCEDURE,FUNCTION,VIEW,TRIGGER...)
开发过程中,需要不停的备份数据库对象, 特别是存储过程, 每次手动备份不免很低能啊 历经几次修改终于, 完美了,O(∩_∩)O哈哈~ (当然,你也可以再改简便一点~~~) select db ...
- Oracle如何实现创建数据库、备份数据库及数据导出导入的一条龙操作
Oracle中对数据对象和数据的管理,无疑都是使用PL/SQL Developer来进行管理,该工具也提供给我们很多方便.快捷的操作,使得我们不再为Oracle本身丑陋.难用的UI而抱怨.由于我们一般 ...
- Sql Server自动备份数据库,定期删除备份
//实现:每天自动备份数据库,定期删除备份 //步骤:[开始]--[所有程序]--[Microsoft SQL Server 2005]--[SQL Server Management Studio] ...
- 知方可补不足~SqlServer自动备份数据库及清理备份文件
回到目录 对于SQLSERVER这个关系型数据库来说,为了保持数据的安全,备份是必须的,当你的一个误操作导致数据丢失,这可能是灾难性的,是不被允许发生的,这时,我们必须要做好定期的备份工作,如我们可以 ...
随机推荐
- python高级(四)—— 文本和字节序列(编码问题)
本文主要内容 字符 字节 结构体和内存视图 字符和字节之间的转换——编解码器 BOM鬼符 标准化Unicode字符串 Unicode文本排序 python高级——目录 文中代码均放在github上: ...
- origin显示三维曲面
准备数据并选中数据: 这里如果只关心z<1部分的趋势,可以对Z轴范围进行调整,双击Z轴的数字: 然后修改显色条的范围,双击曲面: 最后让曲面最上面部分clip掉: 成功了:
- python函数超时情况应对总结
最近处理一个线程中的函数超时问题. 函数里面有一个地方可能会卡死,我们需要去判断这个是不是卡死了,并做出相应的应对方案. 最开始想的是在函数上增加一个装饰器,使其在超时时抛出异常,然后在其他地方捕获这 ...
- MonoGame2D - MonoGame的2D威力加强版
简介MonoGame2D 是一款基于MonoGame的扩展工具包,对MonoGame的2D开发方面进行了扩展,主要增加了精灵,字体,地图,组件,GUI等游戏开发中的一些基本元素,以更方便快捷地进行2D ...
- 网络编程- 解决黏包现象方案二之struct模块(七)
上面利用struct模块与方案一比较,减少一次发送和接收请求,因为方案一无法知道client端发送内容的长度到底有多长需要和接收OK.多一次请求防止黏包,减少网络延迟
- git设置core.autocrlf
背景: 使用虚拟机共享windows文件夹,文件夹中用git clone 一个仓库.在linux下编辑文件,用git status发现几乎所有的文件都为修改状态. 原因: windows下和lin ...
- Jquery ajax, Axios, Fetch区别
1. Jquery ajax, Axios, Fetch区别之我见 2. ajax.axios.fetch之间的详细区别以及优缺点
- jqueyr validtion的使用
江北机场对validtion的扩展 <script type="text/javascript"> $.validator.setDefaults({ /*关闭键盘输入 ...
- Object-c 中的数据类型
导航: 基本类型 ID 对象类型常见的有 对象类型 -NSLog -NSNumber -NSString和NSMutableString -NSArray和NSMutableArray -NSSe ...
- 使用js命名空间进行模块式开发
在java中,为了防止命名冲突和模块式开发,会有个一个import 关键字来进行导包. 在js中为了达到同样的效果,我们也通过给其自定义一个“包”的概念. 直接上代码: 首先有个LC.js文件: // ...