
PostgreSQL (也叫 Postgres)是一个自由的对象-关系数据库服务器(数据库管理系统)。它提供了相对其他开放源代码数据库系统(比如 MySQL 和 Firebird),和对专有系统比如 Oracle、Sybase、IBM 的 DB2 和 Microsoft SQL Server的一种选择。
导出
/usr/bin/pg_dump -U postgres testdb > /home/app/testdb`date +%Y%m%d`.sql
cd /home/app
gzip testdb`date +%Y%m%d`.sql
导入
day=`date +%Y%m%d`
drop database testdb;//删除原来的库
CREATE DATABASE testdb;
psql -U postgres -d testdb -f /home/app/testdb${day}.sql
文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/221242.html<