postgreSQL常用命令:

1.启动数据库:pg_ctl start

pg_ctl -D /home/easytrack/pgsql/data -l logfile start

2.停止数据库:

pg_ctl stop

3.注册数据库:

pg_ctl register -N pgsql -D /home/easytrack/pgsql/data;

4.取消注册:

pg_ctl unregister -N pgsql

5.windows 启动数据库服务;

net start pgsql

6.windows 停止数据库服务:

net stop pgsql

7.创建数据库:

createdb -U easytrack -h 192.168.1.2 easytrack

8.删除数据库:

dropdb -U easytrack -h 192.168.1.2 easytrack

9.备份数据库:

pg_dump -U easytrack -h 192.168.1.2 easytrack > et.sql
pg_dump -U easytrack -h 192.168.1.2 -p 5432 -Fc  -f et.dump easytrack

10.回复数据库:

psql -U easytrack -h 192.168.1.2 easytrack < et.sql
pg_restore -U easytrack -h localhost -d easytrack et.dmp
pg_dump -U easytrack etdemo | psql -U easytrack

你可能感兴趣的:(postgreSQL常用命令:)