title: How to run a postgres command: could not identify current directory
body: <p>I am able to run <code>psql</code> by doing the following:</p>
  
  <pre><code>Davids-d david$ psql --u postgres
  Password for user postgres: 
  psql (9.4.18)
  Type "help" for help.
  
  postgres=# 
  </code></pre>
  
  <p>However, when I run the following command, I get an error:</p>
  
  <pre><code>Davids-iMac:datadocs david$ sudo -u postgres psql -f resources/postgresql/initdb.sql
  could not identify current directory: Permission denied
  </code></pre>
  
  <p>What does this mean, and how would I resolve this? Note that I do have the following var set:</p>
  
  <pre><code>david$ echo $PGDATA
  /Users/david/PostgreSQL/data/pg94
  </code></pre>