title: Postgresql: How @GeneratedValue works in postgresql?
body: <p>I am very new to postgresql. <em>In playframework with Ebean</em>, I have used mysql and auto generated value there was actually auto incremented in that case. The sequence I got was 1,2,3,4...</p>
  
  <p>But in Postgresql, the generated value doesn't seem to have such property. It seems that for every session it is starting with a number larger that the previous session's number and then auto incremented. The sequence in this case, 1,21,41,42,61,81,101,102,103...</p>
  
  <p>My code segment:</p>
  
  <pre><code>@Entity
  public class Post extends Model{
  
      @Id
      @GeneratedValue
      @Required
      public int id;
  </code></pre>
  
  <p>I am using:</p>
  
  <ol>
  <li>Playframework 2.3.4</li>
  <li>Ebean</li>
  <li>Postgres 9.3</li>
  </ol>
  
  <p>I really don't know the reason. Is there any particular reason of such values? Is there any catch about this? Do I need to switch to auto increment? And if so, how do I do it?</p>