[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$ 

 

相关文章:

  • 2022-12-23
  • 2021-08-12
  • 2021-11-19
  • 2021-12-16
  • 2021-12-02
  • 2022-12-23
  • 2021-05-22
猜你喜欢
  • 2021-08-29
  • 2022-12-23
  • 2021-06-20
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
相关资源
相似解决方案