title: How to change the Data directory in Postgresql on Ubuntu 13.04
body: <p>I am having a problem changing the data directory on postgresql 9.1 on ubuntu 13.04:</p>
  
  <p>I first did a:</p>
  
  <pre><code>sudo pg_dropcluster --stop 9.1 main
  </code></pre>
  
  <p>and then attempted to create a new one in the desired path:</p>
  
  <pre><code> sudo pg_createcluster -d /home/fccoelho/Documentos/databases/postgresqldata 9.1 main
  </code></pre>
  
  <p>but i fails with a permission denied:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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.</p>
  
  <p>I also tried to used the initdb binary distributed with POstgresql without success</p>
  
  <p>How do I make this work?</p>