美文网首页
设置postgresql表空间

设置postgresql表空间

作者: 狮子城 | 来源:发表于2018-11-27 22:36 被阅读0次

    linux

    ssh登陆远程服务器

    ssh 192.168.31.109 -l root -p 22
    

    新建用户

    create user test02 password '123';
    

    授予权限,如授予select权限

    grant select on all tables in schema public to test02;
    

    新建数据库表空间

    mkdir /usr/local/pgdata
    chown postgres:postgres /usr/local/pgdata/
    postgres=# create tablespace tbs_test owner postgres location '/usr/local/pgdata';
    

    新建数据库

    CREATE database test_db with owner=test02 template=template0 encoding='UTF8' tablespace=tbs_test connection limit = 100;
    

    修改表空间位置

    ALTER DATABASE "test_db" SET TABLESPACE "tbs_test02";
    

    相关文章

      网友评论

          本文标题:设置postgresql表空间

          本文链接:https://www.haomeiwen.com/subject/krcoqqtx.html