title: PSQLException Returning autogenerated keys is only supported for 8.2 and later servers
body: <p>I'm trying to make an Insert on a table and get the autogenerated Primary Key</p>
  
  <pre><code>    PreparedStatement pstm = dbcon.prepareStatement(sql,Statement.RETURN_GENERATED_KEYS);
  
      pstm.setDate(1, sqlDate);
      pstm.setInt(2, knr);
      pstm.executeUpdate();
      ResultSet rs = pstm.getGeneratedKeys();
  </code></pre>
  
  <p>on the first Line I get the following Error thrown:   </p>
  
  <pre><code>org.postgresql.util.PSQLException: Returning autogenerated keys is only supported for 8.2 and later servers.
  </code></pre>
  
  <p>I have the following Maven Dependency:  </p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;postgresql&lt;/groupId&gt;
          &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
          &lt;version&gt;9.1-901-1.jdbc4&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>And when I use <code>SELECT VERSION();</code> on the DataBase  I get </p>
  
  <pre><code>PostgreSQL 11.4 (Debian 11.4-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit
  </code></pre>
  
  <p>So I dont quite understand why I cannot get the autogenerated keys?<br>
  Am I missing something here, because from what I see, I am above Version 8.2?!  </p>
  
  <p>Thanks in advance</p>