title: data directory "/var/lib/postgresql/9.3/main" has group or world access Permissions should be u=rwx (0700)
body: <p>This issue is occur when changing default permission of postgres. we
  can solve the problem by again applying the default permissions to  postgresql.
  before you change anything understand the default permission of postgres.</p>
  
  <p>first go to /etc/postgresql/9.3/main/ path and put follow command </p>
  
  <p>stat -c "%a %n" *</p>
  
  <pre><code>644 environment
  644 pg_ctl.conf
  640 pg_hba.conf
  640 pg_ident.conf
  644 postgresql.conf
  644 start.conf
  </code></pre>
  
  <p>The numbers represent the default file permission   </p>
  
  <p><strong>First check these file permission are match or not to your file permission</strong>  </p>
  
  <p>If it not match then change all files to above file format, by using following command</p>
  
  <pre><code>sudo chmod file-permission-number file-name
  </code></pre>
  
  <p>like:</p>
  
  <pre><code>sudo chmod 644 environment
  </code></pre>
  
  <p>After change all file permission finally change <strong>main</strong> folder permissoin</p>
  
  <pre><code>chmod -R 700 /var/lib/postgresql/9.3/main
  </code></pre>
  
  <p>Then restart the postgresql server</p>
  
  <pre><code>sudo service postgresql restart
  </code></pre>