[root@localhost ~]# su postgres
bash-4.2$ psql
could not change directory to "/root": Permission denied
psql (9.5.6)
Type "help" for help.
postgres=# psql -Upostgres
postgres-# psql -Upostgres</root/Desktop/db.sql
[root@localhost dreamstart]
# su postgres
bash
-4.2$ psql -Upostgres<db.sql
[root@localhost dreamstart]# su postgres bash-4.2$ psql -Upostgres<db.sql CREATE ROLE ALTER ROLE CREATE DATABASE CREATE DATABASE CREATE DATABASE GRANT GRANT GRANT You are now connected to database "dreamstart_dev" as user "postgres". CREATE SCHEMA CREATE EXTENSION ALTER DATABASE ALTER DATABASE ALTER SCHEMA ALTER SCHEMA GRANT You are now connected to database "dreamstart_prod" as user "postgres". CREATE SCHEMA CREATE EXTENSION ALTER DATABASE ALTER DATABASE ALTER SCHEMA ALTER SCHEMA GRANT You are now connected to database "dreamstart_test" as user "postgres". CREATE SCHEMA CREATE EXTENSION ALTER DATABASE ALTER DATABASE ALTER SCHEMA ALTER SCHEMA GRANT bash-4.2$