zoukankan      html  css  js  c++  java
  • centos7 运行postgres 数据库脚本db.sql

    [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$ 
    
  • 相关阅读:
    Object之总结(一)
    Object之registerNatives
    Object之finalize
    阿里腾讯百度360
    Object之getClass
    Object之clone
    Object之toString
    Object之notify
    Object之wait
    Object之equals与hashCode
  • 原文地址:https://www.cnblogs.com/Amos-Turing/p/6862253.html
Copyright © 2011-2022 走看看