title: Postgres cannot see my PGDATA environment variable
body: <p>Can anyone explain this:</p>
  
  <pre><code>~$ echo $PGDATA
  /Library/PostgreSQL/9.2/data
  
  ~$ cd /Library/PostgreSQL/9.2/
  
  /Library/PostgreSQL/9.2$ sudo su postgres
  
  bash-3.2$ echo $PGDATA
  &lt;blank line&gt;   
  
  bash-3.2$ pg_ctl start
  pg_ctl: no database directory specified and environment variable PGDATA unset
  Try "pg_ctl --help" for more information.
  
  bash-3.2$ export PGDATA="/Library/PostgreSQL/9.2/data"
  
  bash-3.2$ pg_ctl start
  server starting
  
  bash-3.2$ 
  </code></pre>
  
  <p>The following is in my ~/.bashrc file:</p>
  
  <pre><code>export PGDATA="/Library/PostgreSQL/9.2/data"
  </code></pre>
  
  <p>I'm not mis-spelling the path in PGDATA:</p>
  
  <pre><code>                ~$ echo $PGDATA
                  /Library/PostgreSQL/9.2/data
   export PGDATA="/Library/PostgreSQL/9.2/data"
  </code></pre>