首页 > 解决方案 > Creating a Postgres tablepsace on Mac on an external harddisk

问题描述

I'm trying to create a tablespace for Postgres on an external Disk (SSD connected via TB3) The disk is mounted like this: /dev/disk3s1 on /Volumes/External2TB (apfs, local, nodev, nosuid, journaled) Note that I already disabled the "Ignore ownership" option (noowners) as I think that may have been causing permission problems as postgres is running with its own userid. I want the tablespace in /Columes/External2TB/PostgreSQL/space2.

I have:

$ ls -lad /Volumes/External2TB/PostgreSQL/
drwxr-xr-x  3 postgres  daemon  96 Apr 19 01:11 /Volumes/External2TB/PostgreSQL/

and

$ ls -lad /Volumes/External2TB/PostgreSQL/space2/
drwx------  2 postgres  daemon  64 Apr 19 01:11 /Volumes/External2TB/PostgreSQL/space2/

postgres:daemon are indeed the uid:gid that the postgres process is running under

I connect as user postgres with psql and I get:

postgres=#  create tablespace space2 location '/Volumes/External2TB/PostgreSQL/space2';
ERROR:  could not set permissions on directory "/Volumes/External2TB/PostgreSQL/space2": Operation not permitted

I can run a shell as the postgres user and do a chmod at /Volumes/External2TB/PostgreSQL/space2 so I'm at a total loss as to why the postgres process wouldn't be able to do that...

标签: postgresqlmacosunixfile-permissionspermission-denied

解决方案


推荐阅读