title: How to access PostgreSQL pg_log folder without being the postgres user and running into permission issues?
body: <p>On my mac os x development machine,  I have postgres 9.1 installed to <code>/Library/PostgreSQL/9.1</code> and the data directory for PostgreSQL is in <code>/Library/PostgreSQL/9.1/data</code> I have configured logging so I get good logs out of postgres about what sql queries are executing on the server .... etc such that these are written to <code>/Library/PostgreSQL/9.1/data/pg_log</code> I am using the enterprise db pre packaged postgres binary. </p>
  
  <p>The problem is that $PGDATA is owned by the postgres user which is running the postgres processes. When I changed the permissions on the data directory with <code>chmod o+xr data</code> postgres refused to start and tells me that it can not start with the postgres directory having permissions to anything but the postgres user. </p>
  
  <pre><code>FATAL:  data directory "/Library/PostgreSQL/9.1/data" has group or world access
  DETAIL:  Permissions should be u=rwx (0700)
  </code></pre>
  
  <p>Having to sudo in and out of the postgres dir just to get at the log files is annoying.</p>
  
  <p>What is a good way to configure postgres logging on Mac OS X so that it is easy to access the log files from any user that is logged in, rather than having to use sudo or be the postgres user?</p>
  
  <p><strong>UPDATE</strong> See my answer below, for the exact recipe I used to make it work.</p>