[postgis-users] Permission denied when trying to create a tablespace in PostgreSQL

Marco Boeringa marco at boeringa.demon.nl
Tue Nov 24 11:25:12 PST 2020


OK, I can now answer this myself. After more trial and error, and 
somewhat mislead by search results suggesting other stuff, it turns out 
that setting the owner of the '<user_name>' subfolder of 
'media/<user_name>' to the Postgresql administrator solves the issue, 
and allows me to create the tablespaces. I don't know if this has side 
consequences, as that folder was created automatically and had 'root' as 
owner, but for now it seems fine.

Marco

Op 24-11-2020 om 16:26 schreef Marco Boeringa:
> Hi all,
>
> More of a general postgresql question:
>
> It is quite a bit of time ago since I last did this, but I am in the 
> process of rebuilding an Ubuntu 20.4.x virtual machine. Now I 
> succesfully installed PostgreSQL 13.1 + PostGIS 3, but I want to add 
> dedicated tablespaces for data + indexes, to spread the IO load 
> related to the large amount of GIS data.
>
> I have successfully added the two physical drives to my (Hyper-V 
> based) Ubuntu VM, mounted them to media/<user_name>/<subfolder1/2> and 
> set the permissions on the "subfolder1" and "subfolder2" to allow the 
> "PostgreSQL administrator" user full control ("Create and delete 
> files"). The same for the "group" postgres.
>
> I rebooted the VM, and restarted the postgresql service.
>
> Still, when I try to finally create the actual tablespace using 
> pgAdmin4, I get a "Permission denied" type error ("ERROR: could not 
> set permissions on directory").
>
> I remember struggling with this before the last time I recreated a VM 
> from scratch, but can't remember what I did to finally solve this... 
> Anyone a hint to what I missed?
>
> Marco
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users


More information about the postgis-users mailing list