title: How to get the last element of an array in PostgreSQL?
body: <p>The <a href="http://www.postgresql.org/docs/9.2/static/arrays.html" rel="noreferrer">PostgreSQL Documentation on arrays</a> provides an example using <code>[-1]</code> to access what appears to be the last element of an array; however while <code>SELECT arr[2:3];</code> produces <code>{5,9}</code>, <code>arr[2:-1]</code> results in <code>{}</code>. </p>
  
  <p>How can the last element of an array be obtained in PostgreSQL?</p>
  
  <p>Edit: Windows, PostgreSQL v9.2.1 </p>