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$ 
    
  • 相关阅读:
    第36课 经典问题解析三
    第35课 函数对象分析
    67. Add Binary
    66. Plus One
    58. Length of Last Word
    53. Maximum Subarray
    38. Count and Say
    35. Search Insert Position
    28. Implement strStr()
    27. Remove Element
  • 原文地址:https://www.cnblogs.com/Amos-Turing/p/6862253.html
Copyright © 2011-2022 走看看