title: PostgreSQL function for last inserted ID
body: <p>In PostgreSQL, how do I get the last id inserted into a table?</p>
  
  <p>In MS SQL there is SCOPE_IDENTITY().</p>
  
  <p>Please do not advise me to use something like this:</p>
  
  <pre><code>select max(id) from table
  </code></pre>