I am having a problem changing the data directory on postgresql 9.1 on ubuntu 13.04:
I first did a:
sudo pg_dropcluster --stop 9.1 main
and then attempted to create a new one in the desired path:
sudo pg_createcluster -d /home/fccoelho/Documentos/databases/postgresqldata 9.1 main
but i fails with a permission denied:
Creating new cluster (configuration: /etc/postgresql/9.1/main, data: /home/fccoelho/Documentos/databases/postgresqldata/)...
initdb: could not access directory "/home/fccoelho/Documentos/databases/postgresqldata": Permission denied
Error: initdb failed
I should mention That I checked the permissions, tried creating the directory manually and "chowning" to user postgres afterwards, etc. nothing changed the permission denied message.
I also tried to used the initdb binary distributed with POstgresql without success
How do I make this work?