pgsql数据库创建以及压缩包形式导入导出
数据库创建:
createuser -U postgres -w -DRS dbowner
createdb -U postgres -w -O dbowner dbownerdb
psql -U postgres -w -c "ALTER USER dbowner with PASSWORD 'dbownerpass'" -d dbownerdb
psql -U postgres -w -d dbownerdb -f sqlfile.sql
导出:
pg_dump -U postgres dbname -b -o -Fc | gzip > backup_filename
导入:
gzip -dc backup_filename | pg_restore -U postgres -d dbname