When you install Postgres on a Mac and try to use PgAdmin to create your databases, table spaces, etc. You need to know that the PgAdmin Utility runs under the postgres account that it created when you installed the postgres database and utilities.
postgres account is part of the _postgres group
Team
( dscacheutil -q group|grep -i postgres will display the group associated with the postgres account)
It would be best practice to create a new directory under root ( / ) to host table spaces (let's call it /postgresdata , then make postgres:_postgres owners of this directory using the command below)
sudo chown postgres:_postgres /postgresdata
That should do it for you. Then you can create a subdirectory under /postgresdata for each unique tablespace
Kponn
source share