Creating a tablespace in postgresql

后端 未结 2 1799
遥遥无期
遥遥无期 2021-02-12 19:24

I\'m trying to create a tablespace in postgres, but I\'m getting ownership problems. The command I\'m using is:

CREATE TABLESPACE magdat OWNER maggie LOCATION \'         


        
2条回答
  •  难免孤独
    2021-02-12 20:27

    I would hazard a guess that the problem lies in the permissions of the parent directory "/home/john". Your home directory is probably setup so that only your user has access (i.e chmod 700) to it (it's a good thing for your home directory to be chmod 700, don't change it).

    Doing something like:

    mkdir /BSTablespace
    chown postgres:postgres /BSTablespace
    

    and then

    CREATE TABLESPACE magdat OWNER maggie LOCATION '/BSTablespace';
    

    should work fine.

    Regarding the user maggie: database users are not the same as OS users. That isn't to say that you couldn't have a user in both places named maggie-- but you would need to create the user in both the database and the OS for that to happen.

提交回复
热议问题