title: What is the difference between "service postgresql start" and "pg_ctl start"?
body: <p>On Ubuntu 14.04, if i have the PGDATA environment variable set, the two commands</p>
  
  <pre><code>service postgresql start
  </code></pre>
  
  <p>And</p>
  
  <pre><code>pg_ctl start
  </code></pre>
  
  <p>seems to do the same thing: Start the postgres server in the background.
  Without PGDATA set, "pg_ctl start" needs needs the additional <strong>-D /datadir</strong> argument in order to start. The service does not need this. Why is this so? What is the difference between the two ways of starting the server? And how can the service start without knowing the data dir?</p>