1.切换到postgres用户 : sudo su - postgres
2.在shell命令行下,创建数据库exampledb,并指定所有者为dbuser : sudo -u postgres -O dbuser exampledb
3. 导入数据库: pg_restore -d createdb filepath
参考链接:
http://www.ruanyifeng.com/blog/2013/12/getting_started_with_postgresql.html
https://codeday.me/bug/20180824/228265.html